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

Feature/edpc 1323 dev preview from release branch if exists #920

Conversation

victorpablosceruelo
Copy link
Contributor

@victorpablosceruelo victorpablosceruelo commented Jul 18, 2022

IMPLEMENTATION GENERAL IDEAS

  • After deploying to D, if we come back to development phase and request for "developer preview" this one must use as branch the one created when deploying to D. In plain text, the "developer preview" functionality needs to use the branch created for "deploying to D" (we call it "release branch" from now on) if that one exists. When the release branch does not exist, we'll use master for the release manager. When the release branch does not exist and it is not the release manager, we'll use the branch reported in Release Manager's metadata.yml cfg (or master if it is not reported).
  • The idea behind this behaviour is that developers continue working in the stabilization branch until they promote.

DRAWBACKS

  • Developers need to pull the changes to "master" branch (or equivalent) manually, when until now they worked in the other way: they implemented in master and used "developer preview" to see the results before merging into the stabilization branch.

NOTES:

  • Needs to checkout the release branch if it exists, when still in WIP.
  • Needs to commit to that branch, not to master as done until now.
  • Needs to implement this behaviour for all the components, not only for the release manager.
  • Needs to keep previous behaviour when not in WIP.

ENSURE:

  • Behaviour is only changed when in WIP.
  • When release branch is found, every operation against the git repo (pull, push, ...) must be done against that branch.

MANDATORY

  • Implement tests that ensure code behaves as expected.

zxBCN Pablos_Ceruelo,Victor (IT EDS) EXTERNAL added 2 commits July 18, 2022 16:11
…ists' of github.com:opendevstack/ods-jenkins-shared-library into feature/EDPC-1323-dev-preview-from-release-branch-if-exists
@victorpablosceruelo
Copy link
Contributor Author

@fbeba-bi, @petod108, @hrcornejo, @jafarre-viewnext: this is ready for review.
Thanks !!!

@hrcornejo
Copy link
Contributor

@victorpablosceruelo seems good to me, but I couldn't try in a box (connections problems) so I can't verify.

@victorpablosceruelo victorpablosceruelo merged commit d4bf610 into feature/flexible_r2p_jira_workflow Jul 20, 2022
@@ -145,7 +145,8 @@ class FinalizeStage extends Stage {
repoPushTasks << [ (repo.id): {
steps.dir("${steps.env.WORKSPACE}/${MROPipelineUtil.REPOS_BASE_DIR}/${repo.id}") {
if (project.isWorkInProgress) {
git.pushRef(repo.branch)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change needs to be reverted.
If problematic, we'll need to evaluate why.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doing change in PR #925

victorpablosceruelo added a commit that referenced this pull request Aug 16, 2022
* Developer preview uses the release branch if exists, the branch in Release Manager's metadata.yml cfg if not. (#917)

* changelog

* Logging we need to see what is going on.

* Small refactor to clarify what source code does.

* Use release branch if it exists, in dev mode.

* Checkout release branch for developer preview if available.

Co-authored-by: Victor Pablos Ceruelo <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>

* Feature/edpc 1323 dev preview from release branch if exists (#920)

* changelog

* Logging we need to see what is going on.

* Small refactor to clarify what source code does.

* Use release branch if it exists, in dev mode.

* Checkout release branch for developer preview if available.

* Log in debug mode undone jira issues and chapters.

* Log in debug mode comment added to Jira Release Status

* Do branch checkout for non-release repos too-.

* gitReleaseBranch id needs to be saved for future usage in pipeline.

* If release manager branch is master, other comp. branch is defined in yaml.

* Need to push to the branch we are looking for.

* Initialize map before using it.

* typo

* Tests for InitStage

* tests for MROPipelineUtil.

* changelog

Co-authored-by: Victor Pablos Ceruelo <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>

* Removes DIL_P doc. (#914)

* Removes DIL_P doc.

* Trying to log what is being sent to jira

* Correct way to log variable.

* Pretty print map using json format.

* Revert "Correct way to log variable."

This reverts commit 8ae309a.

* Revert "Trying to log what is being sent to jira"

This reverts commit 0367847.

* jcenter is no more available.

* Removes from test checking that DIL_P is generated.

* changelog

Co-authored-by: zxBCN Pablos_Ceruelo,Victor (IT EDS) EXTERNAL <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>

* Sets rePromote field to true by default + tests.

* Check if tag exists.

* Fixes tests readability.

* Need to eval locally if tag exists before creating it.

* edpc 1323 dev preview from release branch if exists (#925)

* changelog

* Logging we need to see what is going on.

* Small refactor to clarify what source code does.

* Use release branch if it exists, in dev mode.

* Checkout release branch for developer preview if available.

* Log in debug mode undone jira issues and chapters.

* Log in debug mode comment added to Jira Release Status

* Do branch checkout for non-release repos too-.

* gitReleaseBranch id needs to be saved for future usage in pipeline.

* If release manager branch is master, other comp. branch is defined in yaml.

* Need to push to the branch we are looking for.

* Initialize map before using it.

* typo

* Tests for InitStage

* tests for MROPipelineUtil.

* changelog

* Reverts problematic change.

Co-authored-by: Victor Pablos Ceruelo <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>

* Feature/edpc 1335 allow to redeploy in D, Q and P (#926)

* Sets rePromote field to true by default + tests.

* Check if tag exists.

* Fixes tests readability.

* Need to eval locally if tag exists before creating it.

* changelog

Co-authored-by: zxBCN Pablos_Ceruelo,Victor (IT EDS) EXTERNAL <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>

* changelog

* Feature/edpc 1335 set repromote to true if unset (#927)

* Sets rePromote field to true by default + tests.

* Check if tag exists.

* Fixes tests readability.

* Need to eval locally if tag exists before creating it.

* changelog

Co-authored-by: zxBCN Pablos_Ceruelo,Victor (IT EDS) EXTERNAL <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>
Co-authored-by: Martinez,Angel (IT EDS) BI-ES-S <angel_2.martinez@boehringer-ingelheim.com>

* Force push in RM tags with redeploy

Co-authored-by: Victor Pablos Ceruelo <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>
Co-authored-by: Martinez,Angel (IT EDS) BI-ES-S <angel_2.martinez@boehringer-ingelheim.com>
Co-authored-by: Jorge Romero <jorge.romeropalma@gmail.com>
Co-authored-by: Rodriguez,Hector (IT EDS) <hector_2.rodriguez@boehringer-ingelheim.com>
victorpablosceruelo pushed a commit that referenced this pull request Aug 16, 2022
* Developer preview uses the release branch if exists, the branch in Release Manager's metadata.yml cfg if not. (#917)

* changelog

* Logging we need to see what is going on.

* Small refactor to clarify what source code does.

* Use release branch if it exists, in dev mode.

* Checkout release branch for developer preview if available.

Co-authored-by: Victor Pablos Ceruelo <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>

* Feature/edpc 1323 dev preview from release branch if exists (#920)

* changelog

* Logging we need to see what is going on.

* Small refactor to clarify what source code does.

* Use release branch if it exists, in dev mode.

* Checkout release branch for developer preview if available.

* Log in debug mode undone jira issues and chapters.

* Log in debug mode comment added to Jira Release Status

* Do branch checkout for non-release repos too-.

* gitReleaseBranch id needs to be saved for future usage in pipeline.

* If release manager branch is master, other comp. branch is defined in yaml.

* Need to push to the branch we are looking for.

* Initialize map before using it.

* typo

* Tests for InitStage

* tests for MROPipelineUtil.

* changelog

Co-authored-by: Victor Pablos Ceruelo <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>

* Removes DIL_P doc. (#914)

* Removes DIL_P doc.

* Trying to log what is being sent to jira

* Correct way to log variable.

* Pretty print map using json format.

* Revert "Correct way to log variable."

This reverts commit 8ae309a.

* Revert "Trying to log what is being sent to jira"

This reverts commit 0367847.

* jcenter is no more available.

* Removes from test checking that DIL_P is generated.

* changelog

Co-authored-by: zxBCN Pablos_Ceruelo,Victor (IT EDS) EXTERNAL <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>

* Sets rePromote field to true by default + tests.

* Check if tag exists.

* Fixes tests readability.

* Need to eval locally if tag exists before creating it.

* edpc 1323 dev preview from release branch if exists (#925)

* changelog

* Logging we need to see what is going on.

* Small refactor to clarify what source code does.

* Use release branch if it exists, in dev mode.

* Checkout release branch for developer preview if available.

* Log in debug mode undone jira issues and chapters.

* Log in debug mode comment added to Jira Release Status

* Do branch checkout for non-release repos too-.

* gitReleaseBranch id needs to be saved for future usage in pipeline.

* If release manager branch is master, other comp. branch is defined in yaml.

* Need to push to the branch we are looking for.

* Initialize map before using it.

* typo

* Tests for InitStage

* tests for MROPipelineUtil.

* changelog

* Reverts problematic change.

Co-authored-by: Victor Pablos Ceruelo <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>

* Feature/edpc 1335 allow to redeploy in D, Q and P (#926)

* Sets rePromote field to true by default + tests.

* Check if tag exists.

* Fixes tests readability.

* Need to eval locally if tag exists before creating it.

* changelog

Co-authored-by: zxBCN Pablos_Ceruelo,Victor (IT EDS) EXTERNAL <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>

* changelog

* Feature/edpc 1335 set repromote to true if unset (#927)

* Sets rePromote field to true by default + tests.

* Check if tag exists.

* Fixes tests readability.

* Need to eval locally if tag exists before creating it.

* changelog

Co-authored-by: zxBCN Pablos_Ceruelo,Victor (IT EDS) EXTERNAL <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>
Co-authored-by: Martinez,Angel (IT EDS) BI-ES-S <angel_2.martinez@boehringer-ingelheim.com>

* Force push in RM tags with redeploy

Co-authored-by: Victor Pablos Ceruelo <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>
Co-authored-by: Martinez,Angel (IT EDS) BI-ES-S <angel_2.martinez@boehringer-ingelheim.com>
Co-authored-by: Jorge Romero <jorge.romeropalma@gmail.com>
Co-authored-by: Rodriguez,Hector (IT EDS) <hector_2.rodriguez@boehringer-ingelheim.com>
victorpablosceruelo added a commit that referenced this pull request Aug 16, 2022
* Developer preview uses the release branch if exists, the branch in Release Manager's metadata.yml cfg if not. (#917)

* changelog

* Logging we need to see what is going on.

* Small refactor to clarify what source code does.

* Use release branch if it exists, in dev mode.

* Checkout release branch for developer preview if available.

Co-authored-by: Victor Pablos Ceruelo <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>

* Feature/edpc 1323 dev preview from release branch if exists (#920)

* changelog

* Logging we need to see what is going on.

* Small refactor to clarify what source code does.

* Use release branch if it exists, in dev mode.

* Checkout release branch for developer preview if available.

* Log in debug mode undone jira issues and chapters.

* Log in debug mode comment added to Jira Release Status

* Do branch checkout for non-release repos too-.

* gitReleaseBranch id needs to be saved for future usage in pipeline.

* If release manager branch is master, other comp. branch is defined in yaml.

* Need to push to the branch we are looking for.

* Initialize map before using it.

* typo

* Tests for InitStage

* tests for MROPipelineUtil.

* changelog

Co-authored-by: Victor Pablos Ceruelo <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>

* Removes DIL_P doc. (#914)

* Removes DIL_P doc.

* Trying to log what is being sent to jira

* Correct way to log variable.

* Pretty print map using json format.

* Revert "Correct way to log variable."

This reverts commit 8ae309a.

* Revert "Trying to log what is being sent to jira"

This reverts commit 0367847.

* jcenter is no more available.

* Removes from test checking that DIL_P is generated.

* changelog

Co-authored-by: zxBCN Pablos_Ceruelo,Victor (IT EDS) EXTERNAL <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>

* Sets rePromote field to true by default + tests.

* Check if tag exists.

* Fixes tests readability.

* Need to eval locally if tag exists before creating it.

* edpc 1323 dev preview from release branch if exists (#925)

* changelog

* Logging we need to see what is going on.

* Small refactor to clarify what source code does.

* Use release branch if it exists, in dev mode.

* Checkout release branch for developer preview if available.

* Log in debug mode undone jira issues and chapters.

* Log in debug mode comment added to Jira Release Status

* Do branch checkout for non-release repos too-.

* gitReleaseBranch id needs to be saved for future usage in pipeline.

* If release manager branch is master, other comp. branch is defined in yaml.

* Need to push to the branch we are looking for.

* Initialize map before using it.

* typo

* Tests for InitStage

* tests for MROPipelineUtil.

* changelog

* Reverts problematic change.

Co-authored-by: Victor Pablos Ceruelo <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>

* Feature/edpc 1335 allow to redeploy in D, Q and P (#926)

* Sets rePromote field to true by default + tests.

* Check if tag exists.

* Fixes tests readability.

* Need to eval locally if tag exists before creating it.

* changelog

Co-authored-by: zxBCN Pablos_Ceruelo,Victor (IT EDS) EXTERNAL <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>

* changelog

* Feature/edpc 1335 set repromote to true if unset (#927)

* Sets rePromote field to true by default + tests.

* Check if tag exists.

* Fixes tests readability.

* Need to eval locally if tag exists before creating it.

* changelog

Co-authored-by: zxBCN Pablos_Ceruelo,Victor (IT EDS) EXTERNAL <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>
Co-authored-by: Martinez,Angel (IT EDS) BI-ES-S <angel_2.martinez@boehringer-ingelheim.com>

* Force push in RM tags with redeploy

Co-authored-by: Victor Pablos Ceruelo <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>
Co-authored-by: Martinez,Angel (IT EDS) BI-ES-S <angel_2.martinez@boehringer-ingelheim.com>
Co-authored-by: Jorge Romero <jorge.romeropalma@gmail.com>
Co-authored-by: Rodriguez,Hector (IT EDS) <hector_2.rodriguez@boehringer-ingelheim.com>

Co-authored-by: Victor Pablos Ceruelo <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>
Co-authored-by: Martinez,Angel (IT EDS) BI-ES-S <angel_2.martinez@boehringer-ingelheim.com>
Co-authored-by: Jorge Romero <jorge.romeropalma@gmail.com>
Co-authored-by: Rodriguez,Hector (IT EDS) <hector_2.rodriguez@boehringer-ingelheim.com>
victorpablosceruelo added a commit that referenced this pull request Aug 31, 2022
* Developer preview uses the release branch if exists, the branch in Release Manager's metadata.yml cfg if not. (#917)

* changelog

* Logging we need to see what is going on.

* Small refactor to clarify what source code does.

* Use release branch if it exists, in dev mode.

* Checkout release branch for developer preview if available.

Co-authored-by: Victor Pablos Ceruelo <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>

* Feature/edpc 1323 dev preview from release branch if exists (#920)

* changelog

* Logging we need to see what is going on.

* Small refactor to clarify what source code does.

* Use release branch if it exists, in dev mode.

* Checkout release branch for developer preview if available.

* Log in debug mode undone jira issues and chapters.

* Log in debug mode comment added to Jira Release Status

* Do branch checkout for non-release repos too-.

* gitReleaseBranch id needs to be saved for future usage in pipeline.

* If release manager branch is master, other comp. branch is defined in yaml.

* Need to push to the branch we are looking for.

* Initialize map before using it.

* typo

* Tests for InitStage

* tests for MROPipelineUtil.

* changelog

Co-authored-by: Victor Pablos Ceruelo <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>

* Removes DIL_P doc. (#914)

* Removes DIL_P doc.

* Trying to log what is being sent to jira

* Correct way to log variable.

* Pretty print map using json format.

* Revert "Correct way to log variable."

This reverts commit 8ae309a.

* Revert "Trying to log what is being sent to jira"

This reverts commit 0367847.

* jcenter is no more available.

* Removes from test checking that DIL_P is generated.

* changelog

Co-authored-by: zxBCN Pablos_Ceruelo,Victor (IT EDS) EXTERNAL <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>

* Sets rePromote field to true by default + tests.

* Check if tag exists.

* Fixes tests readability.

* Need to eval locally if tag exists before creating it.

* edpc 1323 dev preview from release branch if exists (#925)

* changelog

* Logging we need to see what is going on.

* Small refactor to clarify what source code does.

* Use release branch if it exists, in dev mode.

* Checkout release branch for developer preview if available.

* Log in debug mode undone jira issues and chapters.

* Log in debug mode comment added to Jira Release Status

* Do branch checkout for non-release repos too-.

* gitReleaseBranch id needs to be saved for future usage in pipeline.

* If release manager branch is master, other comp. branch is defined in yaml.

* Need to push to the branch we are looking for.

* Initialize map before using it.

* typo

* Tests for InitStage

* tests for MROPipelineUtil.

* changelog

* Reverts problematic change.

Co-authored-by: Victor Pablos Ceruelo <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>

* Feature/edpc 1335 allow to redeploy in D, Q and P (#926)

* Sets rePromote field to true by default + tests.

* Check if tag exists.

* Fixes tests readability.

* Need to eval locally if tag exists before creating it.

* changelog

Co-authored-by: zxBCN Pablos_Ceruelo,Victor (IT EDS) EXTERNAL <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>

* changelog

* Feature/edpc 1335 set repromote to true if unset (#927)

* Sets rePromote field to true by default + tests.

* Check if tag exists.

* Fixes tests readability.

* Need to eval locally if tag exists before creating it.

* changelog

Co-authored-by: zxBCN Pablos_Ceruelo,Victor (IT EDS) EXTERNAL <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>
Co-authored-by: Martinez,Angel (IT EDS) BI-ES-S <angel_2.martinez@boehringer-ingelheim.com>

* Force push in RM tags with redeploy

* Adds log to every single step where we can fail sending status to Jira.

* Including more logs to see where the problem is.

Co-authored-by: Victor Pablos Ceruelo <victor.pablos_ceruelo.ext@boehringer-ingelheim.com>
Co-authored-by: Martinez,Angel (IT EDS) BI-ES-S <angel_2.martinez@boehringer-ingelheim.com>
Co-authored-by: Jorge Romero <jorge.romeropalma@gmail.com>
Co-authored-by: Rodriguez,Hector (IT EDS) <hector_2.rodriguez@boehringer-ingelheim.com>
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

2 participants