[ 
https://issues.apache.org/jira/browse/CASSANDRA-18399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17719571#comment-17719571
 ] 

David Capwell commented on CASSANDRA-18399:
-------------------------------------------

Thanks [~jmckenzie] for the ping... I just saw this (improved my filters to 
better see @s)...

Cool to see this work, and would be great for me to get rid of my own commit 
scripts... [~yifanc]/[~jonmeredith]/[~maedhroz] as I know you all use my 
script...

I sadly don't have time to review and help with this work, but this is what I 
have myself, so merging with this work over time is desirable for me

{code}
[dcapwell ~/src/github/apache/cassandra-commit-scripts] (master) $ ls -1
README.md
ci-test
ci-test-loop
circleci-approval.awk
circleci-enable.py
circleci-fix-parallelism.awk
circleci-verify.py
cleanup-remotes-and-branches.sh
commit-message.sh
dtest-jars.sh
env.sh.template
functions.sh
generate-empty-commit.sh
git-apply-branch
git-apply-commit
git-apply-pr
higher
jira-assignee.sh
jira-authors.sh
jira-issue.sh
jira-reviewers.sh
jira-summary.sh
merge-commit.sh
multibranch-commit.sh
notes
oss-author-lookup.py
oss-diff.sh
oss-pr-ci.sh
template-start-commit-of-mine.sh
template-start-commit.sh
trigger-jenkins-build
update-jvm-upgrade-test-branches.awk
use-python-dtest-repo.sh
{code}

The main thing I have people would care about are

{code}
multibranch-commit.sh -- commit script that knows how to merge cross multiple 
branches and repos, it enforces best practices (as defined by me)
circleci-enable.py -- script to manipulate circle ci to make it faster and run 
what we care about (by default enables all tests and makes sure _repeat is 
enabled... but you can filter for only the domain you care for)
{code}

Glad to see this work and looking forward to it evolving over time!

> Add simple helper script for commiting a change to multiple branches
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-18399
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18399
>             Project: Cassandra
>          Issue Type: Task
>          Components: Build
>            Reporter: Jacek Lewandowski
>            Assignee: Jacek Lewandowski
>            Priority: Low
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> This is just a simple additional script which committers can use to help them 
> merge commits, especially if the change applies to multiple Cassandra 
> versions.
> For example, for CASSANDRA-18153, which applies to 3.0..trunk, it generates 
> the following commands, which then can be run manually:
> {noformat}
> git fetch origin
> git fetch jacek-lewandowski
> # jacek-lewandowski/CASSANDRA-18153-3.0 -> cassandra-3.0
> # 
> --------------------------------------------------------------------------------------------------------
> git switch cassandra-3.0
> git reset --hard origin/cassandra-3.0
> git cherry-pick e7e9b42559 # e7e9b42559 Save host id to system.local and 
> flush immediately after startup
> git cherry-pick -n 99e96a4f95 && git commit -a --amend --no-edit # 99e96a4f95 
> fixes
> git cherry-pick -n c63e3f29f1 && git commit -a --amend --no-edit # c63e3f29f1 
> DO NOT MERGE - CircleCI config
> grep 'CASSANDRA-18153' CHANGES.txt || sed -E -i '/^[0-9]+\.[0-9]+/{s/.*/&\n\ 
> * Save host id to system.local and flush immediately after startup 
> (CASSANDRA-18153)/;:a;n;ba}' CHANGES.txt
> git diff CHANGES.txt
> git add CHANGES.txt
> git commit --amend --no-edit
> (git diff origin/cassandra-3.0..HEAD -- .circleci/ | git apply -R --index) && 
> git commit -a --amend --no-edit # Remove all changes in .circleci directory 
> if you need to
> git diff --name-only origin/cassandra-3.0..HEAD # print a list of all changes 
> files
> # jacek-lewandowski/CASSANDRA-18153-3.11 -> cassandra-3.11
> # 
> --------------------------------------------------------------------------------------------------------
> git switch cassandra-3.11
> git reset --hard origin/cassandra-3.11
> git merge -s ours --log --no-edit cassandra-3.0
> git cherry-pick -n 79e7b90c8f && git commit -a --amend --no-edit # 79e7b90c8f 
> Save host id to system.local and flush immediately after startup
> git cherry-pick -n bdca4c384b && git commit -a --amend --no-edit # bdca4c384b 
> fixes
> git cherry-pick -n 45078e6793 && git commit -a --amend --no-edit # 45078e6793 
> DO NOT MERGE - CircleCI config
> grep 'CASSANDRA-18153' CHANGES.txt || sed -E -i '/^Merged from 3.0/{s/.*/&\n\ 
> * Save host id to system.local and flush immediately after startup 
> (CASSANDRA-18153)/;:a;n;ba}' CHANGES.txt
> git diff CHANGES.txt
> git add CHANGES.txt
> git commit --amend --no-edit
> (git diff origin/cassandra-3.11..HEAD -- .circleci/ | git apply -R --index) 
> && git commit -a --amend --no-edit # Remove all changes in .circleci 
> directory if you need to
> git diff --name-only origin/cassandra-3.11..HEAD # print a list of all 
> changes files
> # jacek-lewandowski/CASSANDRA-18153-4.0 -> cassandra-4.0
> # 
> --------------------------------------------------------------------------------------------------------
> git switch cassandra-4.0
> git reset --hard origin/cassandra-4.0
> git merge -s ours --log --no-edit cassandra-3.11
> git cherry-pick -n 2227c5c7af && git commit -a --amend --no-edit # 2227c5c7af 
> Save host id to system.local and flush immediately after startup
> git cherry-pick -n a71d4e3408 && git commit -a --amend --no-edit # a71d4e3408 
> DO NOT MERGE - CircleCI config
> git cherry-pick -n 6dc53f4e97 && git commit -a --amend --no-edit # 6dc53f4e97 
> fixes
> grep 'CASSANDRA-18153' CHANGES.txt || sed -E -i '/^Merged from 3.0/{s/.*/&\n\ 
> * Save host id to system.local and flush immediately after startup 
> (CASSANDRA-18153)/;:a;n;ba}' CHANGES.txt
> git diff CHANGES.txt
> git add CHANGES.txt
> git commit --amend --no-edit
> (git diff origin/cassandra-4.0..HEAD -- .circleci/ | git apply -R --index) && 
> git commit -a --amend --no-edit # Remove all changes in .circleci directory 
> if you need to
> git diff --name-only origin/cassandra-4.0..HEAD # print a list of all changes 
> files
> # jacek-lewandowski/CASSANDRA-18153-4.1 -> cassandra-4.1
> # 
> --------------------------------------------------------------------------------------------------------
> git switch cassandra-4.1
> git reset --hard origin/cassandra-4.1
> git merge -s ours --log --no-edit cassandra-4.0
> git cherry-pick -n 3584d17b36 && git commit -a --amend --no-edit # 3584d17b36 
> Save host id to system.local and flush immediately after startup
> git cherry-pick -n e7b2ca37e6 && git commit -a --amend --no-edit # e7b2ca37e6 
> DO NOT MERGE - CircleCI config
> git cherry-pick -n 85f3049e90 && git commit -a --amend --no-edit # 85f3049e90 
> fixes
> grep 'CASSANDRA-18153' CHANGES.txt || sed -E -i '/^Merged from 3.0/{s/.*/&\n\ 
> * Save host id to system.local and flush immediately after startup 
> (CASSANDRA-18153)/;:a;n;ba}' CHANGES.txt
> git diff CHANGES.txt
> git add CHANGES.txt
> git commit --amend --no-edit
> (git diff origin/cassandra-4.1..HEAD -- .circleci/ | git apply -R --index) && 
> git commit -a --amend --no-edit # Remove all changes in .circleci directory 
> if you need to
> git diff --name-only origin/cassandra-4.1..HEAD # print a list of all changes 
> files
> # jacek-lewandowski/CASSANDRA-18153 -> trunk
> # 
> --------------------------------------------------------------------------------------------------------
> git switch trunk
> git reset --hard origin/trunk
> git merge -s ours --log --no-edit cassandra-4.1
> git cherry-pick -n 3b9fa1653e && git commit -a --amend --no-edit # 3b9fa1653e 
> DO NOT MERGE - CircleCI config
> git cherry-pick -n e1389f6196 && git commit -a --amend --no-edit # e1389f6196 
> Save host id to system.local and flush immediately after startup
> grep 'CASSANDRA-18153' CHANGES.txt || sed -E -i '/^Merged from 3.0/{s/.*/&\n\ 
> * Save host id to system.local and flush immediately after startup 
> (CASSANDRA-18153)/;:a;n;ba}' CHANGES.txt
> git diff CHANGES.txt
> git add CHANGES.txt
> git commit --amend --no-edit
> (git diff origin/trunk..HEAD -- .circleci/ | git apply -R --index) && git 
> commit -a --amend --no-edit # Remove all changes in .circleci directory if 
> you need to
> git diff --name-only origin/trunk..HEAD # print a list of all changes files
> git push --atomic origin cassandra-3.0 cassandra-3.11 cassandra-4.0 
> cassandra-4.1 trunk -n
> {noformat}
> The generated script takes into account the following:
> - a change can span multiple commits - all of the will be properly squashed 
> (when running a script, you can comment out the commits you don't want to 
> include)
> - when commits leave .circleci directory modified, one of the last commands 
> for each branch reverts those changes
> - the script does its best to update CHANGED.txt properly, to confirm, it 
> always displays the diff for CHANGES.txt
> Note that, the script does not push anything, it just generates the script to 
> be manually run by the committer. 
> I'll appreciate if someone can run it on Mac so we know if there are some 
> fixes needed for MacOS.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to