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

manifest command takes a while when the release PR is merged #747

Closed
ealain opened this issue Mar 30, 2023 · 6 comments · Fixed by #753 or #759
Closed

manifest command takes a while when the release PR is merged #747

ealain opened this issue Mar 30, 2023 · 6 comments · Fixed by #753 or #759
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@ealain
Copy link

ealain commented Mar 30, 2023

TL;DR

When the release PR is merged, manifest command warns

⚠ Expected 1 releases, only found 0

and then

Collecting commits since all latest releases.

which takes a while.

Expected behavior

When the release PR is merged,

  • no warning,
  • find the release or do not create pull requests.

Observed behavior

In runManifest, the createPullRequests function is looking for the latest release before this is actually created by createReleases. This results in needsBootstrap being true and 'Collecting commits since all latest releases'.

Action YAML

on:
  push:
    branches:
      - develop

# since there are deployment jobs, we need to prevent jobs running in parallel
concurrency:
  group: push-develop

name: '🚀 Deploy develop - [test env]'

permissions:
  id-token: write # This is required for aws-actions/configure-aws-credentials@master
  contents: write # This is required for actions/checkout (read) and google-github-actions/release-please-action@v3 (write)
  actions: read # This is required for nrwl/nx-set-shas
  packages: write # This is required for publish
  pull-requests: write # This is required for google-github-actions/release-please-action@v3

defaults:
  run:
    shell: bash

env:
  AWS_REGION: xxx
  AWS_ACCOUNT_ID: xxx

jobs:
  release-please:
    runs-on: ubuntu-latest
    outputs:
      releases_created: ${{ steps.release-please.outputs.releases_created }}
    steps:
      - uses: google-github-actions/release-please-action@v3
        id: release-please
        with:
          command: manifest

Log output

2023-02-27T14:30:16.6304156Z Requested labels: ubuntu-latest		
2023-02-27T14:30:16.6304193Z Job defined at: xxx/search/.github/workflows/push-develop.yml@refs/heads/develop		
2023-02-27T14:30:16.6304218Z Waiting for a runner to pick up this job...		
2023-02-27T14:30:18.3217872Z Job is waiting for a hosted runner to come online.		
2023-02-27T14:30:20.6971750Z Job is about to start running on the hosted runner: Hosted Agent (hosted)		
2023-02-27T14:30:24.1084000Z Current runner version: '2.301.1'		
2023-02-27T14:30:24.1109409Z ##[group]Operating System		
2023-02-27T14:30:24.1109970Z Ubuntu		
2023-02-27T14:30:24.1110242Z 22.04.2		
2023-02-27T14:30:24.1110532Z LTS		
2023-02-27T14:30:24.1110810Z ##[endgroup]		
2023-02-27T14:30:24.1111113Z ##[group]Runner Image		
2023-02-27T14:30:24.1111416Z Image: ubuntu-22.04		
2023-02-27T14:30:24.1111726Z Version: 20230219.1		
2023-02-27T14:30:24.1112233Z Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20230219.1/images/linux/Ubuntu2204-Readme.md		
2023-02-27T14:30:24.1112791Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20230219.1		
2023-02-27T14:30:24.1113215Z ##[endgroup]		
2023-02-27T14:30:24.1113531Z ##[group]Runner Image Provisioner		
2023-02-27T14:30:24.1113803Z 2.0.117.1		
2023-02-27T14:30:24.1114102Z ##[endgroup]		
2023-02-27T14:30:24.1114814Z ##[group]GITHUB_TOKEN Permissions		
2023-02-27T14:30:24.1115312Z Actions: read		
2023-02-27T14:30:24.1115566Z Contents: write		
2023-02-27T14:30:24.1116056Z Metadata: read		
2023-02-27T14:30:24.1116374Z Packages: write		
2023-02-27T14:30:24.1116681Z PullRequests: write		
2023-02-27T14:30:24.1117009Z ##[endgroup]		
2023-02-27T14:30:24.1120523Z Secret source: Actions		
2023-02-27T14:30:24.1120942Z Prepare workflow directory		
2023-02-27T14:30:24.2127396Z Prepare all required actions		
2023-02-27T14:30:24.2309058Z Getting action download info		
2023-02-27T14:30:24.5456010Z Download action repository 'google-github-actions/release-please-action@v3' (SHA:d3c71f9a0a55385580de793de58da057b3560862)		
2023-02-27T14:30:25.2712934Z Complete job name: release-please		
2023-02-27T14:30:25.3690323Z ##[group]Run google-github-actions/release-please-action@v3		
2023-02-27T14:30:25.3690786Z with:		
2023-02-27T14:30:25.3691110Z   command: manifest		
2023-02-27T14:30:25.3691676Z   token: ***		
2023-02-27T14:30:25.3692182Z   fork: false		
2023-02-27T14:30:25.3692508Z   clean: true		
2023-02-27T14:30:25.3692858Z   bump-minor-pre-major: false		
2023-02-27T14:30:25.3693243Z   bump-patch-for-minor-pre-major: false		
2023-02-27T14:30:25.3693710Z   changelog-host: https://github.com		
2023-02-27T14:30:25.3694208Z   github-api-url: https://api.github.com		
2023-02-27T14:30:25.3694711Z   github-graphql-url: https://api.github.com/graphql		
2023-02-27T14:30:25.3695090Z   monorepo-tags: false		
2023-02-27T14:30:25.3695434Z env:		
2023-02-27T14:30:25.3695784Z   AWS_REGION: xxx		
2023-02-27T14:30:25.3696107Z   AWS_ACCOUNT_ID: xxx		
2023-02-27T14:30:25.3696440Z ##[endgroup]		
2023-02-27T14:30:26.0833631Z ❯ Fetching release-please-config.json from branch develop		
2023-02-27T14:30:26.0834362Z ❯ Fetching .release-please-manifest.json from branch develop		
2023-02-27T14:30:26.7755728Z ✔ Building pull requests		
2023-02-27T14:30:26.7777509Z ✔ Building strategies by path		
2023-02-27T14:30:26.7777827Z ❯ frontend/library: node		
2023-02-27T14:30:26.7778177Z ❯ Fetching frontend/library/package.json from branch develop		
2023-02-27T14:30:27.0163969Z ✔ Collecting release commit SHAs		
2023-02-27T14:30:27.0164479Z ❯ release search depth: 400		
2023-02-27T14:30:27.0168973Z ❯ Fetching releases with cursor undefined		
2023-02-27T14:30:27.3784204Z ⚠ Expected 1 releases	 only found 0	
2023-02-27T14:30:27.3785054Z ⚠ Missing 1 paths: frontend/library		
2023-02-27T14:30:27.6239952Z ⚠ Expected 1 releases	 only found 0	
2023-02-27T14:30:27.6240519Z ❯ looking for tagName: search-frontend-v1.14.0		
2023-02-27T14:30:27.6241964Z ✔ Collecting commits since all latest releases		
2023-02-27T14:30:27.6242521Z ❯ commit search depth: 500		
2023-02-27T14:30:27.6250983Z ❯ Set(0) {}		
2023-02-27T14:30:27.6253659Z ❯ Fetching merge commits on branch develop with cursor: undefined		
2023-02-27T14:30:29.0630413Z ❯ Backfilling file list for commit: 2b958da8e7ddfbd2c2e112ba673b8129b189236d		
2023-02-27T14:30:29.5758407Z ❯ Found 3 files		
2023-02-27T14:30:29.5775063Z ❯ Backfilling file list for commit: 6b3c5b2d0491503b3373c235b870674de751773a		
2023-02-27T14:30:29.9329635Z ❯ Found 1 files		
2023-02-27T14:30:29.9332401Z ❯ Backfilling file list for commit: a7e530ed5b956801206a75d6433981db88df4d43		
2023-02-27T14:30:30.2659821Z ❯ Found 1 files		
2023-02-27T14:30:30.2660238Z ❯ Backfilling file list for commit: 6a1719dd03a59d0058b636e3029be401f1d887a4		
2023-02-27T14:30:30.5664187Z ❯ Found 1 files
...
2023-02-27T14:33:01.7835852Z ⚠ No latest release pull request found.		
2023-02-27T14:33:01.7838533Z ✔ Considering: 124 commits		
2023-02-27T14:33:01.7842942Z ❯ component: search-frontend		
2023-02-27T14:33:01.7846413Z ❯ pull request title pattern: undefined		
2023-02-27T14:33:02.6849588Z ❯ Found pull request #138: 'chore(develop): release search-frontend 1.14.0'		
2023-02-27T14:33:02.6867842Z ⚠ There are untagged	 merged release PRs outstanding - aborting	
2023-02-27T14:33:02.6868596Z ❯ Fetching release-please-config.json from branch develop		
2023-02-27T14:33:02.6869527Z ❯ Fetching .release-please-manifest.json from branch develop		
2023-02-27T14:33:02.6878815Z ✔ Building releases		
2023-02-27T14:33:02.6879085Z ✔ Building strategies by path		
2023-02-27T14:33:02.6879342Z ❯ frontend/library: node		
2023-02-27T14:33:03.8241429Z ❯ Found pull request #138: 'chore(develop): release search-frontend 1.14.0'		
2023-02-27T14:33:03.8246027Z ✔ Building release for path: frontend/library		
2023-02-27T14:33:03.8247483Z ❯ type: node		
2023-02-27T14:33:03.8248789Z ❯ targetBranch: develop		
2023-02-27T14:33:03.8258552Z ❯ Fetching frontend/library/package.json from branch develop		
2023-02-27T14:33:03.8263818Z ✔ Creating 1 releases for pull #138		
2023-02-27T14:33:04.6543466Z ❯ adding comment to https://github.com/xxx/search/issue/138		
2023-02-27T14:33:05.9069771Z ❯ removing labels: autorelease: pending from issue/pull 138		
2023-02-27T14:33:05.9073195Z ❯ adding labels: autorelease: tagged from issue/pull 138		
2023-02-27T14:33:06.9868176Z Evaluate and set job outputs		
2023-02-27T14:33:06.9882952Z Set output 'releases_created'		
2023-02-27T14:33:06.9884006Z Cleaning up orphan processes

Additional information

No response

@ealain ealain added the bug label Mar 30, 2023
@chingor13 chingor13 added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Mar 30, 2023
@chingor13
Copy link
Contributor

The logic in this function is opposite from what we do in our app implementation. In the app, we tag releases first, then try to open any new release pull requests if necessary.

@ealain
Copy link
Author

ealain commented Apr 3, 2023

Thank you for the update.

What do you refer to when you say "our app implementation"? This might be interesting to us, to find a workaround until this is solved.

Also, do you have any idea why this function has this logic?

@bcoe
Copy link
Contributor

bcoe commented Apr 3, 2023

@chingor13 do you think that switching the order of operations here:

https://github.com/google-github-actions/release-please-action/blob/main/index.js#L65

Would address this issue?

@ealain
Copy link
Author

ealain commented Apr 12, 2023

Fix works like a charm on our end! Thanks :)

@cdata
Copy link

cdata commented May 9, 2023

Fixing this bug broke our release process. Some of our releases need binary artifacts attached to them that take a while to build. So, we create the releases as drafts, and then set them to non-draft when the binary artifacts are ready to be attached.

As of the fix in #753, we are hitting the bug described in googleapis/release-please#1650. Our releases that are marked as drafts don't have a concrete tag associated with them; then, the action immediately tries to update the release PRs and cannot find a tag associated with the draft releases it just made. The result is that we get an erroneous release PR that includes a huge swath of already-released history for the packages that were marked as drafts.

@josex2r
Copy link

josex2r commented May 9, 2023

Fixing this bug broke our release process. Some of our releases need binary artifacts attached to them that take a while to build. So, we create the releases as drafts, and then set them to non-draft when the binary artifacts are ready to be attached.

As of the fix in #753, we are hitting the bug described in googleapis/release-please#1650. Our releases that are marked as drafts don't have a concrete tag associated with them; then, the action immediately tries to update the release PRs and cannot find a tag associated with the draft releases it just made. The result is that we get an erroneous release PR that includes a huge swath of already-released history for the packages that were marked as drafts.

Same here, since the new release is created as draft the action checks again the git history trying to find the new version tag (which not exists because it is a draft and hasn't been released yet) and then opens a new release pull-request with a lot of old commits as new changes u.u

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment