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

Add 'availableUpgrades' field to Resources #3234

Conversation

yuvalyaron
Copy link
Collaborator

@yuvalyaron yuvalyaron commented Feb 20, 2023

Part of #3118

What is being addressed

Added availableUpgrades property to Resources.

The field lists versions of the template that are available for upgrade - these are versions higher than the current template version of the resource.

Each element in the list contains 2 fields:
version - the template version of the upgrade
forceUpdateRequired - whether the upgrade requires the forceUpdate flag to be sent with the update request (true should be sent for major upgrades and false otherwise).

How is this addressed

  • Added the availableUpgrades field
  • Refactored all of the GET and GET all routes and added a call to the enrichment logic to populate the value
  • Fixed and added tests

@github-actions
Copy link

github-actions bot commented Feb 20, 2023

Unit Test Results

574 tests   574 ✔️  14s ⏱️
    1 suites      0 💤
    1 files        0

Results for commit 0aaddad.

♻️ This comment has been updated with latest results.

@yuvalyaron yuvalyaron marked this pull request as ready for review February 20, 2023 12:28
@yuvalyaron yuvalyaron changed the title 3118 list template versions that we can upgrade to List template versions that a resource can upgrade to Feb 20, 2023
@yuvalyaron yuvalyaron changed the title List template versions that a resource can upgrade to Add availableUpgrades to Resources Feb 20, 2023
@yuvalyaron yuvalyaron changed the title Add availableUpgrades to Resources Add 'availableUpgrades' field to Resources Feb 20, 2023
Copy link
Contributor

@guybartal guybartal left a comment

Choose a reason for hiding this comment

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

@yuvalyaron,
The logic you've implemented is very well, one thing I would consider changing -
If we want to hide the logic behind the API when it's required to pass the force update flag from the client then I would either combine the two version lists with another property besides the version called forceUpdateRequired or at least change the names of the lists to availableVersions{forceUpdateRequired[], nonForceUpdateRequired[]}.

WDYT?

@tamirkamara tamirkamara marked this pull request as draft February 23, 2023 09:05
@yuvalyaron yuvalyaron marked this pull request as ready for review March 23, 2023 09:36
Copy link
Contributor

@guybartal guybartal left a comment

Choose a reason for hiding this comment

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

Looks great! 👌

@yuvalyaron
Copy link
Collaborator Author

/test

@github-actions
Copy link

🤖 pr-bot 🤖

🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/4501205042 (with refid 641cef7e)

(in response to this comment from @yuvalyaron)

@yuvalyaron yuvalyaron enabled auto-merge (squash) March 23, 2023 13:38
@github-actions
Copy link

🤖 pr-bot 🤖

🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/4501207336 (with refid 641cef7e)

(in response to this comment from @yuvalyaron)

@yuvalyaron
Copy link
Collaborator Author

/test

@github-actions
Copy link

🤖 pr-bot 🤖

🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/4531875023 (with refid 641cef7e)

(in response to this comment from @yuvalyaron)

@yuvalyaron yuvalyaron merged commit c94b226 into microsoft:main Mar 27, 2023
@yuvalyaron yuvalyaron deleted the 3118-list-template-versions-that-we-can-upgrade-to branch March 27, 2023 13:35
LizaShak added a commit that referenced this pull request Mar 28, 2023
* Fix firewall log categories (#3313)

fix firewall log categories

* Add question template (#3327)

* Add question template

* update databricks diagram (#3337)

* RP_BUNDLE multiple values fix (#3343)

* added spacing to join and some test rp_bundle vals to the build to ensure breaks if it needs to

* bumped core v

* rp_bundles to secret

* Fix ENABLE_SWAGGER in CI (#3355)

* change ENABLE_SWAGGER to TF_VAR_enable_swagger, and make it false by default

* update changelog

* Add RP_BUNDLE_VALUES to PR Bot (#3368)

Add RP_BUNDLE_VALUES to pr-bot

* Migration for stepId in OperationSteps (#3358)

* add migration for operationStep

* update PR name

* Add 'availableUpgrades' field to Resources (#3234)

* add availableUpgrades field to resources

* enrich resources with availableUpgrades in endpoints

* rename AvailableUpgrades fields

* fix tests

* fix types

* rename variable

* add tests for enrich_resource_with_available_upgrades

* update api version and changelog

* change structure of resource available upgrades

* Dependabot UI updates (#3370)

* Bump @azure/msal-browser from 2.32.1 to 2.33.0 in /ui/app

Bumps [@azure/msal-browser](https://github.com/AzureAD/microsoft-authentication-library-for-js) from 2.32.1 to 2.33.0.
- [Release notes](https://github.com/AzureAD/microsoft-authentication-library-for-js/releases)
- [Commits](AzureAD/microsoft-authentication-library-for-js@msal-browser-v2.32.1...msal-browser-v2.33.0)

---
updated-dependencies:
- dependency-name: "@azure/msal-browser"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump @testing-library/react from 13.4.0 to 14.0.0 in /ui/app

Bumps [@testing-library/react](https://github.com/testing-library/react-testing-library) from 13.4.0 to 14.0.0.
- [Release notes](https://github.com/testing-library/react-testing-library/releases)
- [Changelog](https://github.com/testing-library/react-testing-library/blob/main/CHANGELOG.md)
- [Commits](testing-library/react-testing-library@v13.4.0...v14.0.0)

---
updated-dependencies:
- dependency-name: "@testing-library/react"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump @fluentui/react from 8.105.1 to 8.106.1 in /ui/app

Bumps [@fluentui/react](https://github.com/microsoft/fluentui) from 8.105.1 to 8.106.1.
- [Release notes](https://github.com/microsoft/fluentui/releases)
- [Changelog](https://github.com/microsoft/fluentui/blob/master/azure-pipelines.release-fluentui.yml)
- [Commits](https://github.com/microsoft/fluentui/compare/@fluentui/react_v8.105.1...@fluentui/react_v8.106.1)

---
updated-dependencies:
- dependency-name: "@fluentui/react"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump @types/node from 18.11.9 to 18.14.2 in /ui/app

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.11.9 to 18.14.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump webpack from 5.75.0 to 5.76.1 in /ui/app

Bumps [webpack](https://github.com/webpack/webpack) from 5.75.0 to 5.76.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](webpack/webpack@v5.75.0...v5.76.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Adjust versions

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Tamir Kamara <[email protected]>
Co-authored-by: Marcus Robinson <[email protected]>
Co-authored-by: Guy Bertental <[email protected]>
Co-authored-by: David Moore <[email protected]>
Co-authored-by: Yuval Yaron <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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