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

Smarter rebase on-top of github target logic #3617

Merged
merged 2 commits into from
Jul 12, 2018

Conversation

msheiny
Copy link
Contributor

@msheiny msheiny commented Jun 29, 2018

Ready for review

Fixes #2942

Changes proposed in this pull request:

  • Modifies rebase script to pull from github API instead of hard-coding develop

How should the reviewer test this PR?

Start by populating the following env vars:

  • CIRCLE_PULL_REQUEST
  • CIRCLE_BRANCH - Keep in mind that this looks like a full URL ala https://github.com/freedomofpress/securedrop/pull/3556. You might ask, why didnt @msheiny use CIRCLE_PR_NUMBER to just grab the number like @redshiftzero suggested!!? Well unfortunately that env var only applies to forked PRs.

Okay now run .. devops/scripts/rebase-ci.sh. Make sure stuff doesnt explode. If you have dangling git changes you should get errors about a rebase.

Any special considerations for deployment? Consider both:

Only affects CI. I did take note to look at the parameters from a forked PR on the github API and I'm convinced it'll work fine famous last words

  • I have written a test plan and validated it for this PR

Caveat -- One particular bit I am concerned about is Github API limits... its 60 per hour per host. Now I think we are safe here because we are executing on multiple builders which should change IP addresses.. but something to watch out for.

@msheiny msheiny requested a review from conorsch as a code owner June 29, 2018 16:37
@codecov-io
Copy link

codecov-io commented Jun 29, 2018

Codecov Report

Merging #3617 into develop will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #3617   +/-   ##
========================================
  Coverage    85.04%   85.04%           
========================================
  Files           37       37           
  Lines         2367     2367           
  Branches       260      260           
========================================
  Hits          2013     2013           
  Misses         290      290           
  Partials        64       64

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 68aa4ff...01b9031. Read the comment docs.

Copy link
Contributor

@conorsch conorsch left a comment

Choose a reason for hiding this comment

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

@msheiny Logic looks good to me! Testing locally showed a proper rebase.

However, we still have a dangling commit that was testing-only. That should be removed, then we're good to merge.

msheiny added 2 commits July 12, 2018 10:09
This will hopefully resolve issues pertaining to PRs that target
non-develop branches and fail in particular ways (not to mention its not
an accurate test) when rebased against develop
I was hitting super annoying issues involving embedded quotations.
It seems acceptable to skip that lint check on this particular file
@msheiny msheiny force-pushed the DynamicallyDeterminePRTarget branch from b6298df to 01b9031 Compare July 12, 2018 17:10
@msheiny
Copy link
Contributor Author

msheiny commented Jul 12, 2018

@conorsch i rebased and removed that dangling branch 👍 .. waiting for tests to pass 🤞

Copy link
Contributor

@conorsch conorsch left a comment

Choose a reason for hiding this comment

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

:shipit:

@conorsch conorsch merged commit 4075d6b into develop Jul 12, 2018
@msheiny msheiny deleted the DynamicallyDeterminePRTarget branch July 12, 2018 18:07
@conorsch conorsch mentioned this pull request Jul 13, 2018
conorsch pushed a commit that referenced this pull request Jul 14, 2018
We recently (#3617) modified the CI rebase logic to accommodate more
than just the develop branch. That's good! However, the new logic
assumed that the env var `CIRCLE_PULL_REQUEST` would be defined. Turns
out it's only defined on PRs, which makes sense, but not during CI runs
against a base branch such as "develop".

Modified the rebase script to execute the main block if-and-only-if
`CIRCLE_PULL_REQUEST` is set. Additionally, sprinkled in some more error
checking bash settings at the top of the file, to make future debugging
sessions more straightforward (`set -u` in particular makes mistakes
like this quite clear).

Closes #3639.
@conorsch conorsch mentioned this pull request Jul 14, 2018
5 tasks
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.

3 participants