Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Refactor Companion Update Flow for robustness #253

Merged
merged 2 commits into from
Mar 24, 2021

Conversation

joao-paulo-parity
Copy link
Contributor

@joao-paulo-parity joao-paulo-parity commented Mar 17, 2021

See #252 for context. Unfortunately we don't yet have an integration test suite to be confident about putting those changes in production. Regardless, I thought I should still have it ready here in case there's interest in trying it out with the staging environments, but otherwise this can come along with the PR for #251.

Motivation

  • No need for manual logging before running commands as the run_cmd commands already do it
  • The cleanup checks are now done eagerly instead of the old cleanup routine at the end of the update
  • Meticulously check for errors and communicate them in the merge request

Tested scenarios

Google Cloud logs are more readable now:

Run git ["clone", "-v", "https://x-access-token:${SECRET}@github.com/paritytech/polkadot-for-processbot-staging.git"] in the current directory

Run git ["remote", "get-url", "paritytech"] in ./polkadot-for-processbot-staging

Run git ["remote", "add", "paritytech", "https://x-access-token:${SECRET}@github.com/paritytech/polkadot-for-processbot-staging.git"] in ./polkadot-for-processbot-staging

Run git ["fetch", "paritytech", "test_merge_commit"] in ./polkadot-for-processbot-staging

Run git ["branch", "-D", "test_merge_commit"] in ./polkadot-for-processbot-staging

Run git ["checkout", "--track", "paritytech/test_merge_commit"] in ./polkadot-for-processbot-staging

Run git ["fetch", "origin", "test_merge_commit_owner"] in ./polkadot-for-processbot-staging

Run git ["merge", "origin/test_merge_commit_owner", "--no-ff", "--no-edit"] in ./polkadot-for-processbot-staging

Run cargo ["update", "-vp", "sp-io"] in ./polkadot-for-processbot-staging

Run git ["status", "--short"] in ./polkadot-for-processbot-staging

Run git ["commit", "-am", "update Substrate"] in ./polkadot-for-processbot-staging

Run git ["push", "paritytech", "test_merge_commit"] in ./polkadot-for-processbot-staging

Getting the head SHA after a companion update in paritytech/test_merge_commit

Run git ["rev-parse", "HEAD"] in ./polkadot-for-processbot-staging

Companion updated; waiting for checks on github.com/paritytech/polkadot-for-processbot-staging/pull/6

Closes #252

@joao-paulo-parity joao-paulo-parity force-pushed the failed_commits branch 3 times, most recently from 77adad4 to a3eb79f Compare March 17, 2021 16:42
@joao-paulo-parity
Copy link
Contributor Author

Overall the implementation is finished but I'd like to try to do some manual testing on https://github.com/paritytech/polkadot-for-processbot-staging. Moving to draft for the time being.

@joao-paulo-parity joao-paulo-parity marked this pull request as draft March 17, 2021 17:33
@joao-paulo-parity joao-paulo-parity merged commit 8098a30 into paritytech:master Mar 24, 2021
@joao-paulo-parity joao-paulo-parity deleted the failed_commits branch March 24, 2021 10:18
@joao-paulo-parity joao-paulo-parity added this to the 0.6 milestone Mar 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Companion Update Flow might fail silently
2 participants