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

Change to mainnet and testnet branch for feature development #346

Closed
4 tasks done
CMCDragonkai opened this issue Feb 21, 2022 · 7 comments
Closed
4 tasks done

Change to mainnet and testnet branch for feature development #346

CMCDragonkai opened this issue Feb 21, 2022 · 7 comments
Assignees
Labels
procedure Action that must be executed r&d:polykey:core activity 4 End to End Networking behind Consumer NAT Devices

Comments

@CMCDragonkai
Copy link
Member

CMCDragonkai commented Feb 21, 2022

We can build a staging system for PK.

  • Change master to mainnet
  • Create a staging branch testnet

The testnet branch is an intermediate branch before merging into mainnet.

This is where we should be branching off features and where we should be cherry picking things.

This is where also the CI/CD must apply QA work to, and it must pass before it gets merged into mainnet.

                       mainnet              testnet            feature-branch
                      ┌────┐               ┌────┐             ┌────┐
                      │ C1 │               │ C1 │             │ C1 │
                      │ C2 │               │ C2 │             │ C2 │
                      └─┬──┘               │ C3 │             │ C3 │
                        │                  │ C4 │             │ C4 │
                        │                  └─┬──┘             │ C5 │
                        │                    │                │ C6 │
                        │                    │                └─┬──┘
                        │                    │                  │
                        │                    │◄─────────────────┘
                        │                    │       merge
                        │                  ┌─▼──┐
                        │                  │ C5 │
                        │                  │ C6 │
                        │                  └─┬──┘
                        │                    │                  ───────────┐
                        │             ┌──────▼──────┐                      │
                        │             │ local tests │                      │
                        │             └──────┬──────┘                      │
                        │                    │                             │
                        │                ┌───▼───┐                         │
                        │                │ build │                         │
                        │                └───┬───┘                         │
                        │                    │                             │
                        │               ┌────▼────┐                        │
                        │               │ quality │                        │
                        │               └────┬────┘                        │
                        │    rollback        │                             ├─ CI/CD
                        │       ┌───────────►├───────────────────┐         │
                        │       │            │                   │         │
                        │       │  ┌─────────▼──────────┐ ┌──────▼──────┐  │
                        │       │  │ testnet deployment │ │ pre-release │  │
                        │       │  └─────────┬──────────┘ └─────────────┘  │
                        │       │            │                             │
                        │       │     ┌──────▼────────┐                    │
                        │       └─────┤ testnet tests │                    │
                        │             └──────┬────────┘                    │
                        │                    │                             │
                        │◄───────────────────┘                             │
                        │   fast-forward merge                             │
                        │                                       ───────────┘
                     ┌──▼─┐
                     │ C3 │
                     │ C4 │
                     │ C5 │
                     │ C6 │
                     └─┬──┘
       ┌──────         │
       │               │◄─────────────┐
       │               │              │
       │      ┌────────▼───────────┐  │
       │      │ mainnet deployment │  │ rollback
       │      └────────┬───────────┘  │
       │               │              │
CI/CD ─┤       ┌───────▼───────┐      │
       │       │ mainnet tests ├──────┘
       │       └───────┬───────┘
       │               │
       │          ┌────▼────┐
       │          │ release │
       │          └─────────┘
       └──────

Tasks

  • 1. Create staging branch off master
  • 2. Update CI/CD so that QA runs and nix job only apply to staging branch, the packages job still only applies to master
  • 3. Perhaps testing can be done on staging as well, since there's alot of tests to run, and many branch commits are obviously not ready. On the other hand, we do want a run over the branches as well. What we can do is to automatically ignore WIP commits (prefixed with WIP).
  • 4. Figure out automatic merge to master from staging: https://stackoverflow.com/questions/67516773/is-there-any-way-to-auto-merge-branches-in-gitlab - possibly through GH bot or otherwise.
@CMCDragonkai CMCDragonkai added the procedure Action that must be executed label Feb 21, 2022
@CMCDragonkai
Copy link
Member Author

New feature branches must then branch off staging instead of master.

@emmacasolin @tegefaulkes

@CMCDragonkai
Copy link
Member Author

CMCDragonkai commented Mar 23, 2022

This is our release workflow. The CI/CD will be essential to automating our work.

It also means renaming our branches to mainnet and testnet.

                       mainnet              testnet            feature-branch
                      ┌────┐               ┌────┐             ┌────┐
                      │ C1 │               │ C1 │             │ C1 │
                      │ C2 │               │ C2 │             │ C2 │
                      └─┬──┘               │ C3 │             │ C3 │
                        │                  │ C4 │             │ C4 │
                        │                  └─┬──┘             │ C5 │
                        │                    │                │ C6 │
                        │                    │                └─┬──┘
                        │                    │                  │
                        │                    │◄─────────────────┘
                        │                    │       merge
                        │                  ┌─▼──┐
                        │                  │ C5 │
                        │                  │ C6 │
                        │                  └─┬──┘
                        │                    │                  ───────────┐
                        │             ┌──────▼──────┐                      │
                        │             │ local tests │                      │
                        │             └──────┬──────┘                      │
                        │                    │                             │
                        │                ┌───▼───┐                         │
                        │                │ build │                         │
                        │                └───┬───┘                         │
                        │                    │                             │
                        │               ┌────▼────┐                        │
                        │               │ quality │                        │
                        │               └────┬────┘                        │
                        │    rollback        │                             ├─ CI/CD
                        │       ┌───────────►├───────────────────┐         │
                        │       │            │                   │         │
                        │       │  ┌─────────▼──────────┐ ┌──────▼──────┐  │
                        │       │  │ testnet deployment │ │ pre-release │  │
                        │       │  └─────────┬──────────┘ └─────────────┘  │
                        │       │            │                             │
                        │       │     ┌──────▼────────┐                    │
                        │       └─────┤ testnet tests │                    │
                        │             └──────┬────────┘                    │
                        │                    │                             │
                        │◄───────────────────┘                             │
                        │   fast-forward merge                             │
                        │                                       ───────────┘
                     ┌──▼─┐
                     │ C3 │
                     │ C4 │
                     │ C5 │
                     │ C6 │
                     └─┬──┘
       ┌──────         │
       │               │◄─────────────┐
       │               │              │
       │      ┌────────▼───────────┐  │
       │      │ mainnet deployment │  │ rollback
       │      └────────┬───────────┘  │
       │               │              │
CI/CD ─┤       ┌───────▼───────┐      │
       │       │ mainnet tests ├──────┘
       │       └───────┬───────┘
       │               │
       │          ┌────▼────┐
       │          │ release │
       │          └─────────┘
       └──────

@CMCDragonkai CMCDragonkai changed the title Create staging branch for feature development Change to mainnet and testnet branch for feature development Mar 23, 2022
@CMCDragonkai
Copy link
Member Author

@emmacasolin the NAT testing you're currently doing is now just part of local tests stage.

However once we adapt the tests to also use the testnet.polykey.io, then they form part of testnet tests and also mainnet tests.

Notice how the these are a separate test stage that occurs after the automatic deployment to AWS.

@CMCDragonkai
Copy link
Member Author

CMCDragonkai commented Mar 23, 2022

If the remote testing testnet tests or mainnet tests fail, this should cause a rollback on the deployments.

The rollback may not need to be done automatically in the case of testnet branch, this is because perhaps we want to debug why the it failed.

We could instead just do retries there and then stop if it keeps failing, keeping whatever state of testnet is.

However in the case of mainnet, a rollback should be done if the mainnet final tests fail. This should of course never happen, as that is a production failure.

Since remote tests will involve flaky networking, it's important we put in the necessary retries.

@CMCDragonkai
Copy link
Member Author

The fast forward merge between testnet and mainnet can be user-activated, instead of being automatic. This allows us to do any manual work in-between before pressing the big red button.

@CMCDragonkai
Copy link
Member Author

Actually, in order to align with other repositories, we're not going to change the name of master and staging for now.

This is now done since #379 is a real PR and the bot is operational, will auto-close this once #379 merged to master.

@CMCDragonkai CMCDragonkai self-assigned this Jun 28, 2022
@CMCDragonkai
Copy link
Member Author

Closing as it is done.

@teebirdy teebirdy added the r&d:polykey:core activity 4 End to End Networking behind Consumer NAT Devices label Jul 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
procedure Action that must be executed r&d:polykey:core activity 4 End to End Networking behind Consumer NAT Devices
Development

No branches or pull requests

2 participants