Skip to content

Reuse existing pull request in increment plugin workflow#2874

Closed
peternied wants to merge 2 commits into
opensearch-project:mainfrom
peternied:increment-workflow-reuse-existing
Closed

Reuse existing pull request in increment plugin workflow#2874
peternied wants to merge 2 commits into
opensearch-project:mainfrom
peternied:increment-workflow-reuse-existing

Conversation

@peternied
Copy link
Copy Markdown
Member

Description

Not all plugins can immediately merge changes from this workflow and need to add changes before the generated pull request can be merged. This update prevents that existing branch from being overridden if the job is re-run while we wait for health builds.

Aspiring issue: opensearch-project/security#2210 (comment)

Issues Resolved

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Not all plugins can immediately merge changes from this workflow and need to add changes before the generated pull request can be merged.

Aspiring issue: opensearch-project/security#2210 (comment)

Signed-off-by: Peter Nied <petern@amazon.com>
@peternied peternied requested a review from a team as a code owner November 9, 2022 16:49
@peternied
Copy link
Copy Markdown
Member Author

FYI @DarshitChanpura

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 9, 2022

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.72%. Comparing base (970646d) to head (55260c5).
⚠️ Report is 2158 commits behind head on main.

❌ Your project status has failed because the head coverage (93.72%) is below the target coverage (98.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2874      +/-   ##
============================================
- Coverage     93.80%   93.72%   -0.08%     
============================================
  Files           213      158      -55     
  Lines          4389     4401      +12     
  Branches         10        0      -10     
============================================
+ Hits           4117     4125       +8     
- Misses          266      276      +10     
+ Partials          6        0       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread .github/workflows/increment-plugin-versions.yml
@peternied
Copy link
Copy Markdown
Member Author

@prudhvigodithi Anything else you'd like to see in this pull request?

@prudhvigodithi
Copy link
Copy Markdown
Member

Hey @peternied thanks, just got pulled out of this, one qq did you test with this change in your local fork, that it creates a PR with version increment and then does not override the changes (made while the a PR is open) upon re-push (with workflow re run) ?

@peternied
Copy link
Copy Markdown
Member Author

I did not test it, is there documentation for how to do that?

@prudhvigodithi
Copy link
Copy Markdown
Member

I did not test it, is there documentation for how to do that?

Hey @peternied
I mean just the GH workflow test on your fork repo, example something like this prudhvigodithi/job-scheduler#2

@DarshitChanpura
Copy link
Copy Markdown
Member

I sense that this scenario will only come into play when an auto-cut PR branch for version increment is deleted and the bot attempts to looks for it. Am I correct?

@prudhvigodithi
Copy link
Copy Markdown
Member

I sense that this scenario will only come into play when an auto-cut PR branch for version increment is deleted and the bot attempts to looks for it. Am I correct?

Hey @DarshitChanpura this is moreover related to retain the changes pushed to the version increment branch, so if a PR is open for a version increment and a user pushes some new changes, the AUTO version increment should retain those changes and not override the changes pushed by the user. @peternied please add if i'm missing anything.
@gaiksaya @peterzhuamazon @bbarani @zelinh
Thank you

@DarshitChanpura
Copy link
Copy Markdown
Member

Hey @DarshitChanpura this is moreover related to retain the changes pushed to the version increment branch, so if a PR is open for a version increment and a user pushes some new changes, the AUTO version increment should retain those changes and not override the changes pushed by the user. @peternied please add if i'm missing anything. @gaiksaya @peterzhuamazon @bbarani @zelinh Thank you

Ahh.. got it.. thank you @prudhvigodithi !

@peternied
Copy link
Copy Markdown
Member Author

I did not test it, is there documentation for how to do that?

Hey @peternied I mean just the GH workflow test on your fork repo, example something like this prudhvigodithi/job-scheduler#2

@prudhvigodithi I'm not sure how to setup the secrets in my forked repository, can you help me figure out how to generate the APP_ID?

@prudhvigodithi
Copy link
Copy Markdown
Member

prudhvigodithi commented Nov 18, 2022

Hey @peternied thanks for waiting just getting back on this, you can generate your own app and use that and should work as you are testing on your forked repo, another way is to use the API Token by adding it to the secrets, this should be easy for testing with only change on the line as follows (token: ${{ secrets.PAT }})

        with:
          token: ${{ secrets.PAT }}
          committer: opensearch-ci-bot <opensearch-infra@amazon.com>
          author: opensearch-ci-bot <opensearch-infra@amazon.com>
          commit-message: |
            Increment version to ${{ env.OPENSEARCH_VERSION }}
            Signed-off-by: opensearch-ci-bot <opensearch-infra@amazon.com>
          delete-branch: true
          branch: create-pull-request/${{ env.OPENSEARCH_VERSION }}
          title: '[AUTO] Increment version to ${{ env.OPENSEARCH_VERSION }}'
          body: |
            - Incremented version to **${{ env.OPENSEARCH_VERSION }}**.

@peternied
Copy link
Copy Markdown
Member Author

@prudhvigodithi After playing around with this workflow I tested it, and it didn't work because that isn't how the create PR workflow is built. I'm going to abandon this, maybe someone else can look into it at a future point in time

@peternied peternied closed this Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants