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

Make expedite's branch form more flexible #135

Merged
merged 9 commits into from
Nov 4, 2019

Conversation

emmahsax
Copy link
Contributor

@emmahsax emmahsax commented Nov 1, 2019

What

Make expedite's branch form more flexible. So take iss-123_describe_branch, but also accept iss_123_describe_branch as well.

Why

Because with all underscores is the form that I use, so I want to be able to use expedite with my branches.

Deploy Plan

Does Platform Operations need to know anything special about this deploy? Are migrations present?

Rollback Plan

  • To roll back this change, revert the merge with: git revert -m 1 MERGE_SHA and perform another deploy.

URLs

Links to bug tickets or user stories.

QA Plan

  • Checkout this branch of octopolo
  • Make a branch with the form iss_123_describe_branch in another directory
    git checkout -b iss_123_describe_branch
    git pull origin iss_123_describe_branch
    git commit --allow-empty -m "Empty commit"
    git push
    
  • Go back to the source branch (this branch)
  • Also make a branch with the form iss-123_describe_branch in the same directory
    git checkout -b iss-123_describe_branch
    git pull origin iss-123_describe_branch
    git commit --allow-empty -m "Empty commit"
    git push
    
  • Run bundle exec bin/op pull-request -x with both branches you made
  • Verify two new pull requests were made with the proper titles


self.title = "#{issue} #{descr}"
self.title = "#{issue} #{descr.capitalize}"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Capitalize the first letter of the description


def check_branch_format
return if /.*-\d+_.*/ =~ git.current_branch
return if (/.*-\d+_.*/ =~ git.current_branch || /.*_\d+_.*/ =~ git.current_branch)

Choose a reason for hiding this comment

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

/[A-Za-z]+-\d+_.*/ and /[A-Za-z]+_\d+_.*/ for regex because we probably want them to always start with a letter.


def check_branch_format
return if /.*-\d+_.*/ =~ git.current_branch
return if (/[a-zA-Z]+-\d+_.*/ =~ git.current_branch || /[a-zA-Z]+_\d+_.*/ =~ git.current_branch)
Copy link

Choose a reason for hiding this comment

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

Can this be rewritten as return if /[a-zA-Z]+[-_]\d+_.*/ =~ git.current_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.

Ah oh yes, that would probably work as well... checking for either _ or -.

@emmahsax
Copy link
Contributor Author

emmahsax commented Nov 4, 2019

Thanks @pete2786 !

@emmahsax emmahsax removed the request for review from real-mj-song November 4, 2019 15:22
@emmahsax
Copy link
Contributor Author

emmahsax commented Nov 4, 2019

#136
#137
Wooo! It works!
image

@production-status-check
Copy link

:octocat: Has QA approval

@emmahsax emmahsax merged commit e71e0e6 into master Nov 4, 2019
@emmahsax emmahsax deleted the make_expedite_more_flexible branch July 14, 2020 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants