Add propose script#2462
Conversation
| execute_or_fail("yarn version --no-git-tag-version --new-version #{version}") | ||
| end | ||
|
|
||
| def create_proposal_pr(version) |
There was a problem hiding this comment.
Can we add a check that the users tree is not dirty? If a user has uncommitted changes, git checkout -b will carry them into the new branch, and they'll get committed along with the version bump
There was a problem hiding this comment.
Added helper.rb to re-use preflight checks for both scripts
| bump_version(version) | ||
| update_changelog(version) | ||
|
|
||
| execute_or_fail("git add package.json CHANGELOG.md") |
There was a problem hiding this comment.
Probably fine, but are we sure no files will ever need to be included?
There was a problem hiding this comment.
I can't think of any reason we'd add other files, but if we need to in the future it's probably best to be explicit instead of add .
| BODY | ||
|
|
||
| puts "" | ||
| pr_url = `hub pull-request --base master --head #{branch} -F #{pr_message_file.shellescape}`.strip |
There was a problem hiding this comment.
I think hub is deprecated in favor of GitHub CLI (gh)
There was a problem hiding this comment.
Will address in follow up https://jira.corp.stripe.com/browse/MOBILESDK-4534
|
|
||
| def current_branch | ||
| @branch_name || `git rev-parse --abbrev-ref HEAD`.strip | ||
| def create_git_tag |
There was a problem hiding this comment.
If someone re-runs publish.rb after a partial failure, git tag will fail because the tag already exists. Can we handle this gracefully?
There was a problem hiding this comment.
They should be able to re-run from the step that failed, meaning this will be skipped if e.g. publish is what failed
| end | ||
|
|
||
| current_version = version_and_date.split(" -").first.strip | ||
| current_ver = version_and_date.split(" -").first.strip |
There was a problem hiding this comment.
nit can we keep this name current_version.
There was a problem hiding this comment.
Removed to just call the current_version helper method instead
| JSON.parse(File.read("package.json"))["version"] | ||
| end | ||
|
|
||
| def ensure_on_master |
There was a problem hiding this comment.
is this ever called?
There was a problem hiding this comment.
Called in preflight_checks which has been moved to helpers.rb
Summary
Add propose script to automatically generate proposal PR
Motivation
Testing
Documentation
Select one: