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

Heroku CI fixes #68

Merged
merged 5 commits into from
Jan 31, 2020
Merged

Heroku CI fixes #68

merged 5 commits into from
Jan 31, 2020

Conversation

dzuelke
Copy link
Contributor

@dzuelke dzuelke commented Jan 30, 2020

Context

There is a race condition with CI runs. After the CI build finishes, then the pipeline it is run against doesn't have any apps associated with it. When Heroku sees a pipeline with no apps, it will delete the pipeline. When this happens in a Hatchet powered test then a 403 response will be raised when we manually try to destroy the pipeline since Heroku already purged it.

The workaround

To work around this behavior, we manually create an app and attach it to a pipeline so that Heroku will not delete the pipeline before we are done using it.

This PR

  • write the stack into app.json if set, otherwise tests always run on heroku-18
  • copy app config into the test env in app.json, so config set on the app makes it into the test run
  • couple the app to the CI pipeline, otherwise the pipeline has no apps after the CI run finishes (test run app gets deleted after run), and that'll purge the pipeline, leading to 403s on CI run progress poll or in pipeline deletion

when a CI run finishes, the associated ephemeral app created for the test run internally gets removed almost immediately
the system then sees a pipeline with no apps, and deletes it, also almost immediately
that does, with bad timing, lead to our test run info poll in wait\! to return 403, and/or in the delete_pipeline at the end
so we set up the app if not already done, and then connect it to the pipeline we created
pipeline gets removed at the end, which leaves the app intact
the app will be collected by Reaper sometime later if needed
@dzuelke dzuelke force-pushed the ci_fixes branch 4 times, most recently from f87b593 to b1a2376 Compare January 31, 2020 17:59
@schneems
Copy link
Contributor

Thanks! I released this in version 4.1.0

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.

2 participants