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

Only run CI rebase logic on PRs #3641

Merged
merged 1 commit into from
Jul 14, 2018
Merged

Conversation

conorsch
Copy link
Contributor

Status

Ready for review.

Description of Changes

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.

Testing

As we discovered in in #3617, we'll need to confirm this works after merge, as well as at the PR phase. Review the logic and double-check the error-checking for sanity. I SSH'd into the failed build in order to debug interactively.

Deployment

None, CI only.

Checklist

If you made changes to the server application code:

  • Linting (make ci-lint) and tests (make -C securedrop test) pass in the development container

If you made changes to securedrop-admin:

  • Linting and tests (make -C admin test) pass in the admin development container

If you made changes to the system configuration:

If you made non-trivial code changes:

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

If you made changes to documentation:

  • Doc linting (make docs-lint) passed locally

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
Copy link
Contributor Author

@redshiftzero Testing here is a bit tricky. Try pulling up one of the old failed builds in CircleCI, specifically one of the develop ones—not a PR, since the logic doesn't fail there—and re-run it with SSH. Copy/paste in the script as presented here, execute it, and confirm you exit zero. (It should skip all the logic, which you can observe if you set -x at the top of the script.)

Copy link
Contributor

@redshiftzero redshiftzero left a comment

Choose a reason for hiding this comment

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

SSHed into CI box on develop to test, logic worked as expected. Thanks!

@codecov-io
Copy link

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #3641   +/-   ##
========================================
  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 b68e8c1...9e29386. Read the comment docs.

@redshiftzero redshiftzero merged commit 5fb2127 into develop Jul 14, 2018
@redshiftzero redshiftzero deleted the 3639-fix-ci-rebase-logic branch July 14, 2018 04:01
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