Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v3.14.5 #509

Merged
merged 10 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 0 additions & 47 deletions .github/workflows/pr-auto-create.yml

This file was deleted.

119 changes: 119 additions & 0 deletions .github/workflows/pr-auto-upsert.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: Auto Upsert Release PR

on:
# trigger on push to dev branch
push:
branches:
- dev
# trigger on manual workflow_dispatch
workflow_dispatch:

concurrency:
group: pr-upsert-${{ github.ref }}
cancel-in-progress: true

jobs:
pr-upsert:
name: Upsert PR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: "dev"
# fetch all history so that git log can get all commit messages
fetch-depth: 0

- id: get_summary
name: Get summary from GPT
continue-on-error: true
run: |
# get all commit messages from last release tag to HEAD
git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:%s > /tmp/commit_messages.txt

# replace newlines with \n
sed -i ':a;N;$!ba;s/\n/\\n/g' /tmp/commit_messages.txt

echo "commit messages: $(cat /tmp/commit_messages.txt)"

curl https://api.openai.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${{ secrets.OPENAI_API_KEY }}" \
-d '{
"model": "gpt-3.5-turbo",
"messages": [
{
"role": "system",
"content": "You are now a git commit message summarizer. By analyzing commit messages, you should provide a concise summary, highlighting key changes and updates made in each commit. This can save time and improve clarity for developers working in collaborative projects.\n\nCommits are typically constructed using the Conventional Commit standard.\n\nYour summarized message should consist of 1-3 sentences that are compacted into sentences for each of the categories (e.g. Added, Fixed, Removed). You should NOT use bullet points."
},
{
"role": "user",
"content": "feat: remove deleted required flag\nbuild: add workflow_dispatch\nfeat: add rowsAffected & fix json struct tag\nchore: add logs"
},
{
"role": "assistant",
"content": "Added: `workflow_dispatch`, `rowsAffected`, logs.\nFixed: JSON struct tag.\nRemoved: required flag of `deleted`."
},
{
"role": "user",
"content": "$(cat /tmp/commit_messages.txt)"
}
],
"temperature": 1,
"max_tokens": 256,
"top_p": 1,
"frequency_penalty": 0.1,
"presence_penalty": 0.2
}' | jq -r '.choices[0].message.content' > /tmp/summary.txt

# replace newlines with spaces
sed -i ':a;N;$!ba;s/\n/ /g' /tmp/summary.txt

# replace " with \"
sed -i 's/"/\\"/g' /tmp/summary.txt

echo "summary: $(cat /tmp/summary.txt)"

echo "summary=$(cat /tmp/summary.txt)" >> $GITHUB_OUTPUT

# create a PR from dev to main, with title in form: Release <semver>
# where, <semver> is the next version number to be released, based on the last release in git tag
- name: Create PR
uses: actions/github-script@v6
with:
github-token: ${{ secrets.PAT_FOR_RELEASE_TAGGER }}
script: |
const { data: { tag_name: lastRelease } } = await github.rest.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo
})
const nextRelease = lastRelease.replace(/(\d+)$/, (match, p1) => Number(p1) + 1)
const prTitle = `Release ${nextRelease}`
let body = `> *This PR is automatically created by actions defined in this repository. To see the run log of this action, please click [here](/${{ github.repository }}/actions/runs/${{ github.run_id }})*\n\n---\n\n## Summary\n\n`
body += "${{ steps.get_summary.outputs.summary || '(no summary)' }}"
const existedPR = await github.rest.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
head: `${context.repo.owner}:dev`,
base: 'main'
})
if (existedPR.data.length > 0) {
core.info(`PR already exists: ${existedPR.data[0].html_url}. Updating body...`)
await github.rest.pulls.update({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: existedPR.data[0].number,
body: body
})
core.info(`PR updated: ${existedPR.data[0].html_url}`)
return
}
const pr = await github.rest.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: prTitle,
body: body,
head: context.ref,
base: 'main',
draft: true
})
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ require (
golang.org/x/exp v0.0.0-20220823124025-807a23277127
golang.org/x/mod v0.9.0
golang.org/x/sync v0.5.0
golang.org/x/text v0.13.0
google.golang.org/grpc v1.55.0
golang.org/x/text v0.14.0
google.golang.org/protobuf v1.30.0
gopkg.in/DataDog/dd-trace-go.v1 v1.48.0
gopkg.in/guregu/null.v3 v3.5.0
Expand Down Expand Up @@ -116,6 +115,7 @@ require (
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.16.0 // indirect
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect
google.golang.org/grpc v1.55.0 // indirect
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.1 h1:ZY3108YtBNq96jNZ
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.1/go.mod h1:t8PYl/6LzdAqsU4/9tz28V/kU+asFePvpOMkdul0gEQ=
github.com/aws/aws-sdk-go-v2/config v1.25.4 h1:r+X1x8QI6FEPdJDWCNBDZHyAcyFwSjHN8q8uuus+Axs=
github.com/aws/aws-sdk-go-v2/config v1.25.4/go.mod h1:8GTjImECskr7D88P/Nn9uM4M4rLY9i77hLJZgkZEWV8=
github.com/aws/aws-sdk-go-v2/credentials v1.16.3 h1:8PeI2krzzjDJ5etmgaMiD1JswsrLrWvKKu/uBUtNy1g=
github.com/aws/aws-sdk-go-v2/credentials v1.16.3/go.mod h1:Kdh/okh+//vQ/AjEt81CjvkTo64+/zIE4OewP7RpfXk=
github.com/aws/aws-sdk-go-v2/credentials v1.16.4 h1:i7UQYYDSJrtc30RSwJwfBKwLFNnBTiICqAJ0pPdum8E=
github.com/aws/aws-sdk-go-v2/credentials v1.16.4/go.mod h1:Kdh/okh+//vQ/AjEt81CjvkTo64+/zIE4OewP7RpfXk=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.5 h1:KehRNiVzIfAcj6gw98zotVbb/K67taJE0fkfgM6vzqU=
Expand Down Expand Up @@ -761,6 +759,8 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down
6 changes: 0 additions & 6 deletions internal/app/appconfig/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ type ConfigSpec struct {
// SentryDSN is the DSN of the Sentry server. See https://pkg.go.dev/github.com/getsentry/sentry-go#ClientOptions
SentryDSN string `split_words:"true"`

// LiveHouseEnabled to indicate whether to enable LiveHouse reporting.
LiveHouseEnabled bool `split_words:"true" default:"false"`

// LiveHouseGRPCAddress is the address of the LiveHouse gRPC server.
LiveHouseGRPCAddress string `split_words:"true" default:"localhost:9015"`

// DatadogProfilerEnabled to indicate whether to enable Datadog profiler.
DatadogProfilerEnabled bool `split_words:"true" default:"false"`

Expand Down
1 change: 0 additions & 1 deletion internal/infra/0module.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ func Module() fx.Option {
Redis,
RedSync,
Postgres,
LiveHouse,
GeoIPDatabase,
), fx.Invoke(Datadog))
}
26 changes: 0 additions & 26 deletions internal/infra/livehouse.go

This file was deleted.

Loading