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

Autodetect new features in gcloud SDK #1422

Closed
pawelpasterz opened this issue Dec 23, 2020 · 3 comments · Fixed by #1436
Closed

Autodetect new features in gcloud SDK #1422

pawelpasterz opened this issue Dec 23, 2020 · 3 comments · Fixed by #1436

Comments

@pawelpasterz
Copy link
Contributor

Author the user story for this feature

As a flank committer, I want to know when the new gcloud SDK feature is introduced so I can ensure the flank is fully compatible.

Describe the solution
An issue should be created when gcloud SDK introduces a new option (command, flag, etc) that is not implemented in the flank.

Possible solutions:

  1. The easiest approach would be just to check if a new version of SDK was released and notify (via issue)
  2. Manual checking may be time-consuming so ideally, we would have more detailed info. We can achieve this by tracking the release notes https://cloud.google.com/sdk/docs/release-notes#firebase_test_lab and create a new issue with info only related to test lab
  3. The best would be to have very specific info on what was changed, missing etc. This approach needs to be investigating.

Once the solution is picked, provide detailed info in the documentation.

@bootstraponline
Copy link
Contributor

#1200 🙂

@pawelpasterz
Copy link
Contributor Author

pawelpasterz commented Dec 24, 2020

#1200 🙂

?
#1200 is an epic for #1420 and this one

@bootstraponline
Copy link
Contributor

ah, makes sense! they looked like two duplicate issues to me

piotradamczyk5 pushed a commit that referenced this issue Dec 31, 2020
Fixes #1422 

TLDR;
Fetch and parse `gcloud SDK` release notes to find new features/changes. If there are any -- create an epic with each new feature/change as a separate issue.

##### What it actually does?
1. Get the latest commit (current master sha)
1. Get previously checked commit (one that was previously 'latest')
1. Get new and old versions (fetch `VERSION` file) based on commits
1. If `new` == `old` -- no updates, exit process
1. Fetch `RELEASE_NOTES` file from the current master
1. Extract (with regex) section with chnages from `new` (included) till `old` (excluded)
1. Extract `Firebase Test Lab` changes only
1. Create a list of changes (each `*` is considered as a separate change/feature)
1. Create issues for each change
1. Create an issue with all changes and convert it to epic
1. Link 'change issues' to the created epic
1. If an epic (from the previous check) was not closed/finished -- do not create a new one, but update it instead

Example issue: pawelpasterz#107

## Test Plan
> How do we know the code works?

Again, it's a bit tricky to test implementation. (As promised, it will be refactored)
You need to have:
* zenhub enabled for your repo (don't have to flank fork)
* zenhub repo id
* zenhub key
* PAT (with full access preferably)

Preparation:
* change zenhub repo id https://github.com/Flank/flank/blob/d1814271875824d7c4ae286566a0637a9e026ea6/flank-scripts/src/main/kotlin/flank/scripts/zenhub/ZenHubAPI.kt#L13
* change repo (your repo/fork) https://github.com/Flank/flank/blob/d1814271875824d7c4ae286566a0637a9e026ea6/flank-scripts/src/main/kotlin/flank/scripts/github/GithubApi.kt#L35
* create `gcloud SDK` label in your repo (might be not required, github can handle new labels somehow(?) )
* enable creating issues in your repo

1. `./gradlew assemble`
1.  run `java -jar ./flank-scripts/build/libs/flank-scripts.jar shell firebase checkForSdkUpdate --github-token=[github token] --zenhub-token=[zenhub token]`
1. Depends of what repo (fork or not) did you use, there might be info about workflow found or not. But it should end with `No new commits`
    ```
    ** Find previously checked commit
    ** No workflow run found for update_dependencies_and_client.yml
    ** Commit found:
          SHA: 8de5b70bc8996687e097d604815018c7b60f29d3
          timestamp: 2020-12-16T04:09:10Z
    ** Find latest commit
    ** Commit found:
          SHA: 8de5b70bc8996687e097d604815018c7b60f29d3
          timestamp: 2020-12-16T04:09:10Z
    ** No new commits since the last run
    ```
1. replace https://github.com/Flank/flank/pull/1436/files#diff-45b4dc40914b7eba78ddf9e571c0f217266d4fb7e544552d2bfcaa2c7a94fb1dR23 with `2020-09-16T04:09:10Z`
1. re-assemble and run, the output should look like one below + issues are created (of course, links and numbers will differ)
    ```
    ** Find previously checked commit
    ** Commit found:
          SHA: 43cc3f11d80e138f456a002f0481c65aea092902
          timestamp: 2020-09-16T04:07:35Z
    ** Find latest commit
    ** Commit found:
          SHA: 8de5b70bc8996687e097d604815018c7b60f29d3
          timestamp: 2020-12-16T04:09:10Z
    ** No opened issue
    ** New version 321.0.0
    ** Old version 310.0.0
    ** Create linked issues
    ** Issue created:
         url:    pawelpasterz#98
         number: 98
    ** Issue created:
         url:    pawelpasterz#99
         number: 99
    ** Issue created:
          url:    pawelpasterz#100
          number: 100
    ** Issue created:
         url:    pawelpasterz#101
         number: 101
    ** Create new epic
    ** Issue created:
         url:    pawelpasterz#102
         number: 102
    ** Issue 102 successfully converted to an epic
    ```
1.  change the date again but this time with `2020-10-16T04:09:10Z`
1. change https://github.com/Flank/flank/pull/1436/files#diff-1a833b8e4991c1e9615c5634567625ff14a5ca97672158fe6352f37b29b6794cR10 with your username
1. re-assemble and run
    ```
    ** Find previously checked commit
    ** Commit found:
          SHA: e58409d11d3079338a2f01ef70d8e1fb283b3977
          timestamp: 2020-09-30T04:08:19Z
    ** Find latest commit
    ** Commit found:
          SHA: 8de5b70bc8996687e097d604815018c7b60f29d3
          timestamp: 2020-12-16T04:09:10Z
    ** Issue found: pawelpasterz#107
    ** New version 321.0.0
    ** Old version 312.0.0
    ** Create linked issues
    ** Issue created:
         url:    pawelpasterz#108
         number: 108
    ** Issue created:
         url:    pawelpasterz#109
         number: 109
    ** Issue created:
         url:    pawelpasterz#110
         number: 110
    ** Issue created:
         url:    pawelpasterz#111
         number: 111
    ** Update existing epic
    ** Issues successfully added to the issue 107
    ```

## Checklist

- [x] Documented
- [x] Unit tested
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants