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

feat: 1422 autodetect new gcloud features #1436

Merged
merged 6 commits into from
Dec 31, 2020

Conversation

pawelpasterz
Copy link
Contributor

@pawelpasterz pawelpasterz commented Dec 30, 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)
  2. Get previously checked commit (one that was previously 'latest')
  3. Get new and old versions (fetch VERSION file) based on commits
  4. If new == old -- no updates, exit process
  5. Fetch RELEASE_NOTES file from the current master
  6. Extract (with regex) section with chnages from new (included) till old (excluded)
  7. Extract Firebase Test Lab changes only
  8. Create a list of changes (each * is considered as a separate change/feature)
  9. Create issues for each change
  10. Create an issue with all changes and convert it to epic
  11. Link 'change issues' to the created epic
  12. 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:

  1. ./gradlew assemble
  2. run java -jar ./flank-scripts/build/libs/flank-scripts.jar shell firebase checkForSdkUpdate --github-token=[github token] --zenhub-token=[zenhub token]
  3. 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
    
  4. replace https://github.com/Flank/flank/pull/1436/files#diff-45b4dc40914b7eba78ddf9e571c0f217266d4fb7e544552d2bfcaa2c7a94fb1dR23 with 2020-09-16T04:09:10Z
  5. 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:    https://github.com/pawelpasterz/flank/issues/98
         number: 98
    ** Issue created:
         url:    https://github.com/pawelpasterz/flank/issues/99
         number: 99
    ** Issue created:
          url:    https://github.com/pawelpasterz/flank/issues/100
          number: 100
    ** Issue created:
         url:    https://github.com/pawelpasterz/flank/issues/101
         number: 101
    ** Create new epic
    ** Issue created:
         url:    https://github.com/pawelpasterz/flank/issues/102
         number: 102
    ** Issue 102 successfully converted to an epic
    
  6. change the date again but this time with 2020-10-16T04:09:10Z
  7. change https://github.com/Flank/flank/pull/1436/files#diff-1a833b8e4991c1e9615c5634567625ff14a5ca97672158fe6352f37b29b6794cR10 with your username
  8. 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: https://github.com/pawelpasterz/flank/issues/107
    ** New version 321.0.0
    ** Old version 312.0.0
    ** Create linked issues
    ** Issue created:
         url:    https://github.com/pawelpasterz/flank/issues/108
         number: 108
    ** Issue created:
         url:    https://github.com/pawelpasterz/flank/issues/109
         number: 109
    ** Issue created:
         url:    https://github.com/pawelpasterz/flank/issues/110
         number: 110
    ** Issue created:
         url:    https://github.com/pawelpasterz/flank/issues/111
         number: 111
    ** Update existing epic
    ** Issues successfully added to the issue 107
    

Checklist

  • Documented
  • Unit tested

@github-actions
Copy link
Contributor

github-actions bot commented Dec 30, 2020

Timestamp: 2020-12-31 09:34:48
Buildscan url for ubuntu-workflow run 454271591
https://gradle.com/s/yhwanspkwjx46

@pawelpasterz pawelpasterz force-pushed the 1422-autodetect-new-gcloud-features branch 2 times, most recently from 05e7ecf to a3ffe27 Compare December 30, 2020 07:02
@pawelpasterz pawelpasterz marked this pull request as ready for review December 30, 2020 07:59
@mergify
Copy link

mergify bot commented Dec 30, 2020

Title does not follow the guidelines of Conventional Commits.
Please adjust title before merge and use one of following prefix:

  • build - Changes that affect the build system or external dependencies (dependencies update)
  • ci - Changes to our CI configuration files and scripts (basically directory .github/workflows)
  • docs - Documentation only changes
  • feat - A new feature
  • fix - A bug fix
  • chore - Changes which does not touch the code (ex. manual update of release notes). It will not generate release notes changes
  • refactor - A code change that contains refactor
  • style - Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • test - Adding missing tests or correcting existing tests and also changes for our test app
  • perf - A code change that improves performance (I do not think we will use it)

@pawelpasterz pawelpasterz changed the title feature: 1422 autodetect new gcloud features feat: 1422 autodetect new gcloud features Dec 30, 2020
@pawelpasterz pawelpasterz force-pushed the 1422-autodetect-new-gcloud-features branch from ed29f2b to bc695cf Compare December 31, 2020 09:29
Copy link
Contributor

@Sloox Sloox left a comment

Choose a reason for hiding this comment

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

👍

@piotradamczyk5 piotradamczyk5 merged commit 3999433 into master Dec 31, 2020
@piotradamczyk5 piotradamczyk5 deleted the 1422-autodetect-new-gcloud-features branch December 31, 2020 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autodetect new features in gcloud SDK
3 participants