Package: braumeister
,---.   ,---.    .--.  .-. .-.         ,---.  ,-.   .---.  _______ ,---.  ,---.    
 | .-.\  | .-.\  / /\ \ | | | ||\    /| | .-'  |(|  ( .-._)|__   __|| .-'  | .-.\   
 | |-' \ | `-'/ / /__\ \| | | ||(\  / | | `-.  (_) (_) \     )| |   | `-.  | `-'/   
 | |--. \|   (  |  __  || | | |(_)\/  | | .-'  | | _  \ \   (_) |   | .-'  |   (    
 | |`-' /| |\ \ | |  |)|| `-')|| \  / | |  `--.| |( `-'  )    | |   |  `--.| |\ \   
 /( `--' |_| \)\|_|  (_)`---(_)| |\/| | /( __.'`-' `----'     `-'   /( __.'|_| \)\  
(__)         (__)              '-'  '-'(__)                        (__)        (__)braumeisteris a release-candidate preparation tool for git and JIRA users.
Given a fix-version, it gathers git branches mentioned in JIRA issues targetting this fix-version and merges them in a release-candidate branch.InstallationThebraumeisterrequires at least Python3.5Install with:pip3installbraumeisterConfigurationYou can initialize thebraumeisterinside the root directory of a git repository like this:braumeisterinitThebraumeisterwill create a.braumeisterconfiguration file in the current directory. The configuration may look like this:[general]verbose=false[git]main_branch_name=main[jira]url=https://your-domain.atlassian.netusername=my-userpassword=my-api-tokendestination_transition=Mergedbranch_custom_field_id=customfield_5711Sectionkeydefault valuedescriptiongeneralverbosefalseVerbose outputgitmain_branch_namemasterDefine the main branch name for your git projectjiraurlNoneJIRA Base URLjirausernameNoneA JIRA UserjirapasswordNoneThe password for the userjiradestination_transitionNoneWorkflow Transition name for the ticket after merging, if executed with-ujirabranch_custom_field_idNoneThe JIRA Custom Field where we should read the branch fromWe'll be looking for a configuration file at the following places[CURRENT-DIRECTORY]/.braumeister
~/.braumeisterIt's recommended to add the following files to your.gitignore.braumeister
release_state.jsonJIRA ConfigurationCustom Field für Branch anlegenIn JIRA, pressgg(or.) to open the "Quick Actions" > TypeCustom Fields>Add custom field>Text field (single line)>NextName: Branch
Description: git BranchIn the next screen, you need to assign the created field to one or more screens.
Thebranch_custom_field_idiscustomfield_[ID]whereas theIDis the number in the URL behind thecustomFieldId=.
e.g.:https://jira.dev/secure/admin/ConfigureCustomField!default.jspa?customFieldId=57111Here, the JIRA Custom Field Id is5711, so thebraumeisterconfiguration forbranch_custom_field_idwould becustomfield_5711.DescriptionThebraumeisterrequests all issues from JIRA with the given release name asFix Version.
In theses tickets, we'll search for the configured custom field (eg Branch) containing the git branch.
The release branch will be created like this:release/[cleaned_release_name]_RC_[LATEST_RC + 1]If thebraumeisterdiscovered a branch with the same name, we'll increase theRCpart with 1 (with leading zeros). The first release branch will have the RC001.For each of theses branches, the following commands will be executed:$gitcheckout$branch$gitpull
$gitmergeorigin/main
$gitpushorigin$branch$gitcheckout$release_branch$gitmergeorigin/$branch$gitbranch-D$branchAfter merging all branches to the release branch, the branch will be pushed toorigin.ConflictsIf there are any conflicts during the merge of a branch, thebraumeisterwill stop and write the current state to arelease_state.jsonfile. The output may looks like this:$braumeister-n"Barking Dog"candidate[*]RequestingallissueswithfixVersion:BarkingDog[+]Requestingissue:https://jira.dev/rest/api/2/issue/5711[+]Requestingissue:https://jira.dev/rest/api/2/issue/5712[+]Requestingissue:https://jira.dev/rest/api/2/issue/5713[+]ThelastbranchforRCBarkingDogis:release/Barking_Dog_RC_002[+]Creatingnewbranch'release/Barking_Dog_RC_003'frommaster

Branch'release/Barking_Dog_RC_003'setuptotrackremotebranch'master'from'origin'.
Switchedtoanewbranch'release/Barking_Dog_RC_003'[🍻]Mergingfeature-2...[🍻]Branch'feature-2'merged[🍻]Mergingfeature-1...

Writingstatejson!

Amergeerroroccuredwhilemergingfeatureintorelease/Barking_Dog_RC_003

Pleasedothefollowingsteps:*Resolvetheconflicts*Committhechanges*Callthescriptagainwiththeoption-rThebraumeisterwill stay in the current release branch to let you resolve the conflict. After the conflict has been resolved, you can rerun thebraumeisterwith-rto resume where we stopped.$braumeister-n"Barking Dog"-rcandidate
Readingstatejson!
Resumingwithfeature-1[🍻]Mergingfeature-1...[🍻]Branch'feature-1'merged[🍻]Mergingaffe...[🍻]Branch'affe'merged

Deletingstatejson![🍻]Alldone.Graba🍺ExamplesRelease CandidateNew release candidate$braumeister-n"Barking Dog"candidate[*]RequestingallissueswithfixVersion:BarkingDog[+]Requestingissue:https://jira.dev/rest/api/2/issue/5711[+]Creatingnewbranch'release/Barking_Dog_RC_001'frommaster

Branch'release/Barking_Dog_RC_001'setuptotrackremotebranch'master'from'origin'.
Switchedtoanewbranch'release/Barking_Dog_RC_001'[🍻]Mergingaffe...[🍻]Branch'affe'merged[🍻]Alldone.Graba🍺Existing release candidateWhen you execute thebraumeisterwith the same release name again, a new release candidate will be created (increasing theRCpart with 1).$braumeister-n"Barking Dog"candidate[*]RequestingallissueswithfixVersion:BarkingDog[+]Requestingissue:https://jira.dev/rest/api/2/issue/5711[+]ThelastbranchforRCBarkingDogis:release/Barking_Dog_RC_001[+]Creatingnewbranch'release/Barking_Dog_RC_002'frommaster

Branch'release/Barking_Dog_RC_002'setuptotrackremotebranch'master'from'origin'.
Switchedtoanewbranch'release/Barking_Dog_RC_002'[🍻]Mergingaffe...[🍻]Branch'affe'merged[🍻]Alldone.Graba🍺Update JIRA issueExecuting thebraumeisterwith-uwill also execute the configured transition on all related issues.$braumeister-n"Barking Dog"-ucandidate[*]RequestingallissueswithfixVersion:BarkingDog[+]Requestingissue:https://jira.dev/rest/api/2/issue/31300[+]Requestingissue:https://jira.dev/rest/api/2/issue/30209[+]ThelastbranchforRCBarkingDogis:release/Barking_Dog_RC_004[+]Creatingnewbranch'release/Barking_Dog_RC_005'frommaster

Branch'release/Barking_Dog_RC_005'setuptotrackremotebranch'master'from'origin'.
Switchedtoanewbranch'release/Barking_Dog_RC_005'[🍻]Mergingfeature-1...[🍻]Branch'feature-1'merged[🍻]Mergingaffe...[🍻]Branch'affe'merged

Deletingstatejson!
------------------------------------[+]UpdatestatustoMergedonallrelatedjiraissues!
------------------------------------
Requestingalltransitionsfor:DEV-1
UpdatingjirastatusonDEV-1toStagingNeeded
------------------------------------
Requestingalltransitionsfor:DEV-2
UpdatingjirastatusonDEV-2toStagingNeeded[🍻]Alldone.Graba🍺ReleaseNew release$braumeister-n"Barking Dog"release[*]RequestingallissueswithfixVersion:BarkingDog[+]Requestingissue:https://jira.dev/rest/api/2/issue/5711[+]Creatingnewbranch'release/Barking_Dog_GA'frommaster

Branch'release/Barking_Dog_GA'setuptotrackremotebranch'master'from'origin'.
Switchedtoanewbranch'release/Barking_Dog_GA'[🍻]Mergingaffe...[🍻]Branch'affe'merged[🍻]Alldone.Graba🍺Finalize a releaseWhen you execute thebraumeisterwith thefinalizeaction it will merge the given branch back to define main branch (e.g.origin/main).THIS CHANGES YOUR REMOTE REPOSITORY, HANDLE WITH CARE!$braumeister-n"Barking Dog"finalize[+]Mergingbranch'release/Barking_Dog_GA'toorigin/master[🍻]Mergingrelease/Barking_Dog_GA...[🍻]Branch'release/Barking_Dog_GA'merged[🍻]Alldone.Graba🍺Cleanup after a releaseWhen you execute thebraumeisterwith thecleanupaction it will delete all branches associated with tickets in yourfixVersion.THIS CHANGES YOUR REMOTE REPOSITORY, HANDLE WITH CARE!$braumeister-n"Barking Dog"cleanup[+]CleaningupafterreleaseofBarkingDog[🍻]Deletingorigin/feature-nifty...[🍻]Deletingorigin/feature-seven...[🍻]Deletingorigin/feature-eleven...[🍻]Brewhouseallcleanagain.Graba🍺DevelopmentRunning testsmaketest