Skip to content

[changelog] updated changelog #8010

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

Closed
wants to merge 8 commits into from
Closed
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
14 changes: 9 additions & 5 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,37 @@
name: Changelog

on:
push:
branches:
- mads/use-reviews-for-changelog
schedule:
- cron: "0 0 * * *"

jobs:

build:

runs-on: ubuntu-latest

container: eu.gcr.io/gitpod-core-dev/dev/changelog:0.0.34
container: eu.gcr.io/gitpod-core-dev/dev/changelog:0.0.36

steps:
- uses: actions/checkout@v2
- run: |
export PR_BRANCH=$(date '+rq/changelog_%Y%m%d%H%M')
# For testing, using a branch that is not main.
export GITHUB_REF=mads/old-changelog
git checkout -b $PR_BRANCH
/app/changelog update -t $TOKEN -o gitpod-io -r gitpod -b $GITHUB_REF
/app/changelog update -t $TOKEN -o gitpod-io -r gitpod -b main
if [[ $(git status --porcelain) ]]; then
git config --global user.name $GITHUB_USER
git config --global user.email $GITHUB_EMAIL
git add CHANGELOG.md
git commit -m "[changelog] updated changelog"
git push origin $PR_BRANCH
/app/changelog pr -t $TOKEN -o gitpod-io -r gitpod -b $GITHUB_REF -H $PR_BRANCH
/app/changelog pr -t $TOKEN -a $APPROVAL_TOKEN -o gitpod-io -r gitpod -b $GITHUB_REF -H $PR_BRANCH
fi
env:
GITHUB_USER: roboquat
GITHUB_EMAIL: roboquat@gitpod.io
TOKEN: ${{ secrets.ROBOQUAT_AUTOMATIC_CHANGELOG }}
APPROVAL_TOKEN: ${{ secrets.GITOPS_BOT_PR_APPROVAL_TOKEN }}
shell: bash
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# Change Log

## February 2022
- Fix missing status updates for prebuilds. ([#7968](https://github.com/gitpod-io/gitpod/pull/7968)) - [@AlexTugarev](https://github.com/AlexTugarev)
- reduce idle DB load on SH installations ([#7940](https://github.com/gitpod-io/gitpod/pull/7940)) - [@geropl](https://github.com/geropl)
- [gitlab] user-scoped env vars can now be filtered for nested repos on Gitlab ([#7978](https://github.com/gitpod-io/gitpod/pull/7978)) - [@JanKoehnlein](https://github.com/JanKoehnlein)
- Update PyCharm IDE image to version 213.6777.50. ([#7943](https://github.com/gitpod-io/gitpod/pull/7943)) - [@roboquat](https://github.com/roboquat)
- Update PhpStorm IDE image to version 213.6777.58. ([#7944](https://github.com/gitpod-io/gitpod/pull/7944)) - [@roboquat](https://github.com/roboquat)
- [installer]: add jaeger sampling options to the tracing object ([#7727](https://github.com/gitpod-io/gitpod/pull/7727)) - [@MrSimonEmms](https://github.com/MrSimonEmms)
- [server] Support 'git@{host}:{user}/{repo}.git' format in context URLs ([#7951](https://github.com/gitpod-io/gitpod/pull/7951)) - [@jankeromnes](https://github.com/jankeromnes)
- Admins can do a text search for projects and their associated prebuilds. ([#7882](https://github.com/gitpod-io/gitpod/pull/7882)) - [@laushinka](https://github.com/laushinka)
- [installer]: put component ownership under webapp/workspace teams ([#7839](https://github.com/gitpod-io/gitpod/pull/7839)) - [@MrSimonEmms](https://github.com/MrSimonEmms)
- [wa-manager] Refactor connectToWorkspaceDaemon helper ([#7926](https://github.com/gitpod-io/gitpod/pull/7926)) - [@aledbf](https://github.com/aledbf)

## January 2022
## January 0001
- Fix integration tests ([#7827](https://github.com/gitpod-io/gitpod/pull/7827)) - [@kylos101](https://github.com/kylos101), [@sagor999](https://github.com/sagor999)
- [server] Ensure incremental prebuilds always use the latest config ([#7805](https://github.com/gitpod-io/gitpod/pull/7805)) - [@jankeromnes](https://github.com/jankeromnes)
- [dashboard][server] Make Project overview page load faster by pre-fetching and caching Git provider data (branch details) ([#7610](https://github.com/gitpod-io/gitpod/pull/7610)) - [@jankeromnes](https://github.com/jankeromnes)
Expand Down
35 changes: 28 additions & 7 deletions dev/changelog/pullrequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ import (
)

type PullRequestOptions struct {
Title string
Body string
Token string
Org string
Repo string
BaseBranch string
HeadBranch string
Title string
Body string
Token string
ApprovalToken string
Org string
Repo string
BaseBranch string
HeadBranch string
}

var prOpts = &PullRequestOptions{}
Expand All @@ -33,6 +34,9 @@ var pullRequestCommand = &cobra.Command{
Short: "Creates a PR to update the changelog.",
Run: func(c *cobra.Command, args []string) {
client := NewClient(prOpts.Token)
// PRs can't be approved by the author of the PR. Thus we need two clients.
// One for creating the PR and one for approving it.
approvalClient := NewClient(prOpts.ApprovalToken)
context := context.Background()
newPr := &github.NewPullRequest{
Title: &prOpts.Title,
Expand Down Expand Up @@ -100,13 +104,30 @@ var pullRequestCommand = &cobra.Command{
l += *label.Name
}
logger.WithField("labels", l).WithField("pr", pr.Number).Info("PR labels successfully added")

retries = 0
for {
retries++
if retries > 60 {
logger.WithError(err).Fatal("Timeout trying to approve PR")
}
event := "APPROVE"
_, _, err := approvalClient.PullRequests.CreateReview(context, prOpts.Org, prOpts.Repo, *pr.Number, &github.PullRequestReviewRequest{Event: &event})
if err != nil {
logger.WithError(err).Error("Error approving PR. Trying again in a bit.")
time.Sleep(time.Second)
} else {
break
}
}
},
}

func init() {
// Setup prFlags before the command is initialized
prFlags := pullRequestCommand.PersistentFlags()
prFlags.StringVarP(&prOpts.Token, "token", "t", prOpts.Token, "a GitHub personal API token to perform authenticated requests")
prFlags.StringVarP(&prOpts.ApprovalToken, "approval-token", "a", prOpts.Token, "a GitHub personal API token to perform PR approval")
prFlags.StringVarP(&prOpts.Org, "org", "o", prOpts.Org, "the github organization")
prFlags.StringVarP(&prOpts.Repo, "repo", "r", prOpts.Repo, "the github repository name")
prFlags.StringVarP(&prOpts.HeadBranch, "head", "H", "main", "the head branch for pull requests")
Expand Down