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

feat/abs-1416 #26

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

feat/abs-1416 #26

wants to merge 6 commits into from

Conversation

tonsve
Copy link

@tonsve tonsve commented Jan 15, 2025

Work started on feat/abs-1416
https://smg-re.atlassian.net/browse/ABS-1416

Various improvements :

In order for new branch to be created based on the latest version of main, we need to run 2 commands before git checkout - b BranchName

One way of doing this is to run :

git checkout main
git pull

We also allow empty commit :
git commit --allow-empty -m "chore: initialize ${BRANCH_NAME}"

We verify for uncommitted staged changes, and inform what would happen to those :

if ! git diff --cached --quiet; then \
    echo "You have uncommitted staged changes. By continuing this will include those changes in the first commit of the new branch and PR."; \
...

@tonsve tonsve marked this pull request as ready for review January 19, 2025 16:14
@tonsve tonsve requested a review from gergo-dryrun January 19, 2025 16:14
Copy link
Author

@tonsve tonsve left a comment

Choose a reason for hiding this comment

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

@gergo-dryrun
We have 2 issues
not All repos have "main" as default branch.
Making my git checkout main not working in case of "master" as default.

this command is also going to fail if default branch is not "main".
gh pr create --repo "$REPO" --title "${BRANCH_NAME}${PR_TITLE}" --body "Work started on $BRANCH_NAME" --base main --draft; \
with error
pull request create failed: GraphQL: Head sha can't be blank, Base sha can't be blank, No commits between main and feat/ABS-1417, Base ref must be a branch (createPullRequest)

We could verify if default branch is main or master, before applying the commands ?

@tonsve
Copy link
Author

tonsve commented Feb 2, 2025

@gergo-dryrun
Though this version includes all changes we have talked about, the test file doesn't work.
But it also doesn't work with the main branch anymore either it seems.
3/4 tests are constantly failing for me.

We can get back to this when I am back from holiday on the week of 11th February.

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.

1 participant