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

[Backport 1.3] Staging for version increment automation #2029

Merged
merged 3 commits into from
Sep 28, 2022

Conversation

peternied
Copy link
Member

Backport 235d256 from #1932

Note; had to remove BWC related changes since they were not included until 2.0 of this codebase

@peternied peternied requested a review from a team August 15, 2022 15:42
@peternied peternied marked this pull request as draft August 15, 2022 15:44
@peternied
Copy link
Member Author

I think that CI isn't going to work with this change, keeping this out there if we want to avoid cutting PRs like #2028 (review)

@codecov-commenter
Copy link

codecov-commenter commented Aug 15, 2022

Codecov Report

Merging #2029 (b4bbe71) into 1.3 (c7bdcb5) will increase coverage by 0.02%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##                1.3    #2029      +/-   ##
============================================
+ Coverage     64.66%   64.68%   +0.02%     
- Complexity     3217     3219       +2     
============================================
  Files           247      247              
  Lines         17350    17350              
  Branches       3087     3087              
============================================
+ Hits          11219    11223       +4     
+ Misses         4582     4578       -4     
  Partials       1549     1549              
Impacted Files Coverage Δ
...ecurity/configuration/ConfigurationRepository.java 75.27% <0.00%> (+2.19%) ⬆️

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

@prudhvigodithi
Copy link
Contributor

Hey @peternied this worked I have tested with branch backport/backport-1932-to-1.3, by executing the task ./gradlew updateVersion -DnewVersion=1.3.5-SNAPSHOT. But I see fileset(dir: projectDir) was included with empty set of files, and a separate line was added for buid.gradle file, I see from the past PR we need to update the version at 2 places in build.gradle file opensearch_version = System.getProperty("opensearch.version", "1.3.5-SNAPSHOT") and securityPluginVersion, so how about you add the task following.

task updateVersion {
    onlyIf { System.getProperty('newVersion') }
    doLast {
        ext.newVersion = System.getProperty('newVersion')
        println "Setting version to ${newVersion}."
        // String tokenization to support -SNAPSHOT
        ant.replaceregexp(match: opensearch_version.tokenize('-')[0], replace: newVersion.tokenize('-')[0], flags:'g', byline:true) {
            fileset(dir: projectDir) {
                     include(name: 'build.gradle')
            }
        }
    }
} 

Or something like the following being explicit

        ant.replaceregexp(file:'build.gradle', match: "securityPluginVersion = '\\d.*'", replace: '"securityPluginVersion = "' + newVersion.tokenize('-')[0] + '.0"', flags:'g', byline:true)
        ant.replaceregexp(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true)

@prudhvigodithi
Copy link
Contributor

prudhvigodithi commented Sep 1, 2022

Hey @peternied any update on this, one of the workflow job failed as this task updateVersion is not part of 1.3 branch. Can you please check my comment and merge the PR.
@bbarani @gaiksaya

@prudhvigodithi
Copy link
Contributor

Hey @peternied can you please post an update, without this task the the next version of the security repo is not happening. For 1.3.6 the increment has to be done manually
Thank you
@zelinh @bbarani

@cwperks
Copy link
Member

cwperks commented Sep 23, 2022

@peternied I am unable to re-run CI for this PR. Does this PR (#2001) need to be backported to 1.3?

@peternied
Copy link
Member Author

@peternied I am unable to re-run CI for this PR. Does this PR (#2001) need to be backported to 1.3?

No - permissions are set to the repository, not on individual branches. I am also unable to re-run the job - but its moot because the failure in build-artifact-names needs to be resolved

prudhvigodithi and others added 2 commits September 24, 2022 00:44
* Version increment automation

Signed-off-by: pgodithi <pgodithi@amazon.com>
(cherry picked from commit 235d256)
Incorperating changes from
#1741

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

Signed-off-by: Peter Nied <petern@amazon.com>
@peternied peternied marked this pull request as ready for review September 24, 2022 00:46
@peternied peternied merged commit 6b32c47 into 1.3 Sep 28, 2022
@peternied peternied deleted the backport/backport-1932-to-1.3 branch September 28, 2022 22:00
@peternied
Copy link
Member Author

Note, I bypassed CI checks because there were stuck on random failures, CI passed on 2/3 platforms already

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.

None yet

5 participants