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

Reuse existing pull request in increment plugin workflow #2874

Conversation

peternied
Copy link
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
Member Author

FYI @DarshitChanpura

@codecov-commenter
Copy link

codecov-commenter commented Nov 9, 2022

Codecov Report

Merging #2874 (55260c5) into main (970646d) will decrease coverage by 0.07%.
The diff coverage is n/a.

@@             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     
Impacted Files Coverage Δ
src/manifests/test_manifest.py 85.71% <0.00%> (-11.66%) ⬇️
src/test_workflow/integ_test/integ_test_suite.py 85.71% <0.00%> (-8.41%) ⬇️
src/test_workflow/test_cluster.py 85.33% <0.00%> (-3.24%) ⬇️
src/system/os.py 100.00% <0.00%> (ø)
src/run_bwc_test.py 87.50% <0.00%> (ø)
src/git/git_commit.py 100.00% <0.00%> (ø)
src/run_integ_test.py 87.50% <0.00%> (ø)
src/system/console.py 100.00% <0.00%> (ø)
src/system/execute.py 100.00% <0.00%> (ø)
src/system/process.py 93.54% <0.00%> (ø)
... and 187 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches

Signed-off-by: Peter Nied <petern@amazon.com>
Signed-off-by: Peter Nied <peternied@hotmail.com>
@peternied
Copy link
Member Author

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

@prudhvigodithi
Copy link
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
Member Author

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

@prudhvigodithi
Copy link
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
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
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
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
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
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
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