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

Staging for version increment automation #1932

Merged
merged 8 commits into from
Aug 1, 2022

Conversation

prudhvigodithi
Copy link
Contributor

@prudhvigodithi prudhvigodithi commented Jul 10, 2022

Signed-off-by: pgodithi pgodithi@amazon.com

Description

This is the staging PR for to execute workflows that auto raise the version increment PR's
Example: prudhvigodithi#2

  • Category: Enhancement

Issues Resolved

Part of: opensearch-project/opensearch-build#1375
From solution: opensearch-project/opensearch-build#1375 (comment)
Related issue: #1930

Is this a backport? If so, please add backport PR # and/or commits #

Testing

Example: prudhvigodithi#2

Check List

  • New functionality includes testing
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

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.

Signed-off-by: pgodithi <pgodithi@amazon.com>
@prudhvigodithi prudhvigodithi requested a review from a team July 10, 2022 22:11
Signed-off-by: pgodithi <pgodithi@amazon.com>
Signed-off-by: pgodithi <pgodithi@amazon.com>
@prudhvigodithi prudhvigodithi added backport 2.x backport to 2.x branch backport 2.1 backport 2.0 backport to 2.0 branch labels Jul 10, 2022
@prudhvigodithi
Copy link
Contributor Author

Referred old 2.x version increment PR: #1881
@dblock @bbarani

@codecov-commenter
Copy link

codecov-commenter commented Jul 10, 2022

Codecov Report

Merging #1932 (8c9a499) into main (be876c0) will increase coverage by 0.01%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##               main    #1932      +/-   ##
============================================
+ Coverage     61.00%   61.01%   +0.01%     
- Complexity     3233     3234       +1     
============================================
  Files           256      256              
  Lines         18088    18088              
  Branches       3224     3224              
============================================
+ Hits          11035    11037       +2     
+ Misses         5470     5467       -3     
- Partials       1583     1584       +1     
Impacted Files Coverage Δ
...a/org/opensearch/security/tools/SecurityAdmin.java 37.31% <0.00%> (-0.25%) ⬇️
...nsearch/security/dlic/rest/api/AuditApiAction.java 68.08% <0.00%> (+4.25%) ⬆️
...ecurity/configuration/StaticResourceException.java 25.00% <0.00%> (+25.00%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us.

Copy link
Member

@peternied peternied left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before we merge this change should have a test to ensure its functionality.

build.gradle Outdated
@@ -486,3 +486,20 @@ afterEvaluate {
tasks = ['build', 'buildRpm', 'buildDeb']
}
}

// versionIncrement: Task to auto increment to the next development iteration
task versionIncrement {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added @peternied can you please check.
Thank you

Signed-off-by: pgodithi <pgodithi@amazon.com>
@@ -125,6 +125,8 @@ jobs:

- run: ./gradlew clean assemble -Dbuild.version_qualifier=${{ env.TEST_QUALIFIER }} && test -s ./build/distributions/opensearch-security-${{ env.SECURITY_PLUGIN_VERSION_ONLY_NUMBER }}-${{ env.TEST_QUALIFIER }}-SNAPSHOT.zip

- run: ./gradlew clean versionIncrement -DnewVersion=3.0.0-SNAPSHOT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This executes the command, but doesn't verify any outcome.

What do you think about adding a execution of the gradle task assemble, check the artifact is version X, then run the versionIncrement task, then assemble and check its version X+1

Signed-off-by: pgodithi <pgodithi@amazon.com>
@prudhvigodithi
Copy link
Contributor Author

Renaming to task updateVersion following opensearch-project/opensearch-plugin-template-java#32.

Copy link
Member

@DarshitChanpura DarshitChanpura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. I agree with Peter's ask on testing to verify whether this change would work, if it is possible.

@peternied
Copy link
Member

@prudhvigodithi Do you need any help with this?

@prudhvigodithi
Copy link
Contributor Author

@prudhvigodithi Do you need any help with this?

Hey @peternied I should be pushing the requested change by end of today, just got pulled away from this :)

Signed-off-by: pgodithi <pgodithi@amazon.com>
Signed-off-by: pgodithi <pgodithi@amazon.com>
Signed-off-by: pgodithi <pgodithi@amazon.com>
@prudhvigodithi
Copy link
Contributor Author

prudhvigodithi commented Jul 26, 2022

Hey @peternied and @DarshitChanpura I have updated the CI workflow running the task updateVersion with an increment of existing majorVersion + 1. Please check
Thank you
https://github.com/opensearch-project/security/runs/7512662131?check_suite_focus=true
@bbarani @peterzhuamazon

@bbarani
Copy link
Member

bbarani commented Jul 26, 2022

@davidlago @peternied @DarshitChanpura Can you please review this PR soon?

Copy link
Member

@peternied peternied left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Member

@DarshitChanpura DarshitChanpura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @prudhvigodithi !

Copy link
Member

@DarshitChanpura DarshitChanpura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @prudhvigodithi !

@peternied peternied merged commit 235d256 into opensearch-project:main Aug 1, 2022
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.0 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.0 2.0
# Navigate to the new working tree
cd .worktrees/backport-2.0
# Create a new branch
git switch --create backport/backport-1932-to-2.0
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 235d25672139c0663b422c3f7a2354e0250f23b0
# Push it to GitHub
git push --set-upstream origin backport/backport-1932-to-2.0
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.0

Then, create a pull request where the base branch is 2.0 and the compare/head branch is backport/backport-1932-to-2.0.

opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 1, 2022
* Version increment automation

Signed-off-by: pgodithi <pgodithi@amazon.com>
(cherry picked from commit 235d256)
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.1 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.1 2.1
# Navigate to the new working tree
cd .worktrees/backport-2.1
# Create a new branch
git switch --create backport/backport-1932-to-2.1
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 235d25672139c0663b422c3f7a2354e0250f23b0
# Push it to GitHub
git push --set-upstream origin backport/backport-1932-to-2.1
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.1

Then, create a pull request where the base branch is 2.1 and the compare/head branch is backport/backport-1932-to-2.1.

DarshitChanpura pushed a commit to DarshitChanpura/security that referenced this pull request Aug 1, 2022
* Version increment automation

Signed-off-by: pgodithi <pgodithi@amazon.com>
bharath-techie pushed a commit to bharath-techie/security that referenced this pull request Aug 12, 2022
* Version increment automation

Signed-off-by: pgodithi <pgodithi@amazon.com>
@prudhvigodithi
Copy link
Contributor Author

Hey @peternied I see the following PR is closed #1933, but this change is not backported to 1.x (1.3) branches, can you please take a look?

Thank you

@peternied peternied added the backport 1.3 backport to 1.3 branch label Aug 15, 2022
@opensearch-trigger-bot
Copy link
Contributor

The backport to 1.3 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.3 1.3
# Navigate to the new working tree
cd .worktrees/backport-1.3
# Create a new branch
git switch --create backport/backport-1932-to-1.3
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 235d25672139c0663b422c3f7a2354e0250f23b0
# Push it to GitHub
git push --set-upstream origin backport/backport-1932-to-1.3
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.3

Then, create a pull request where the base branch is 1.3 and the compare/head branch is backport/backport-1932-to-1.3.

peternied pushed a commit that referenced this pull request Aug 15, 2022
* Version increment automation

Signed-off-by: pgodithi <pgodithi@amazon.com>
(cherry picked from commit 235d256)
peternied pushed a commit that referenced this pull request Aug 15, 2022
* Version increment automation

Signed-off-by: pgodithi <pgodithi@amazon.com>
(cherry picked from commit 235d256)
peternied pushed a commit that referenced this pull request Aug 15, 2022
* Version increment automation

Signed-off-by: pgodithi <pgodithi@amazon.com>
(cherry picked from commit 235d256)
peternied pushed a commit that referenced this pull request Aug 15, 2022
* Version increment automation

Signed-off-by: pgodithi <pgodithi@amazon.com>
(cherry picked from commit 235d256)
peternied pushed a commit that referenced this pull request Aug 15, 2022
* Version increment automation

Signed-off-by: pgodithi <pgodithi@amazon.com>
(cherry picked from commit 235d256)
peternied pushed a commit that referenced this pull request Aug 15, 2022
* Version increment automation

Signed-off-by: pgodithi <pgodithi@amazon.com>
(cherry picked from commit 235d256)
@peternied
Copy link
Member

@prudhvigodithi Could you double check #2029 and make sure it will work as expected?

peternied pushed a commit that referenced this pull request Sep 24, 2022
* Version increment automation

Signed-off-by: pgodithi <pgodithi@amazon.com>
(cherry picked from commit 235d256)
peternied added a commit that referenced this pull request Sep 28, 2022
* Staging for version increment automation (#1932)

Incorporating changes from
#1741

Specifically build.gradle changes, see 2744081#diff-49a96e7eea8a94af862798a45174e6ac43eb4f8b4bd40759b5da63ba31ec3ef7

Signed-off-by: pgodithi <pgodithi@amazon.com>
Signed-off-by: Peter Nied <petern@amazon.com>
Co-authored-by: Prudhvi Godithi <pgodithi@amazon.com>
(cherry picked from commit 235d256)
stephen-crawford pushed a commit to stephen-crawford/security that referenced this pull request Nov 10, 2022
* Version increment automation

Signed-off-by: pgodithi <pgodithi@amazon.com>
Signed-off-by: Stephen Crawford <steecraw@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.3 backport to 1.3 branch backport 2.x backport to 2.x branch backport 2.0 backport to 2.0 branch backport 2.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants