astro-cli icon indicating copy to clipboard operation
astro-cli copied to clipboard

Software backward compatible with CLI

Open neel-astro opened this issue 2 years ago • 2 comments

Description

Changes:

  • Add logic via high-level function in cmd/software package to remove commands based on the Houston version connected
  • Add logic via decorator in houston package to hide the API based on the Houston version connected
  • Add logic to define if varying GraphQL queries based on the Houston version, so that the correct query is picked up based on the Houston version
  • Add logic to hide --use-runtime-version & --use-astronomer-certified flags in astro dev init cmd, in case CLI is connected to Houston version < 0.29

Minor Changes:

  • Move all the methods in Houston ClientInterface to follow a fixed signature func(req AnyRequestType) (AnyResponseType, error), so that the Houston decorator can consume it
  • Move Houston GraphQL queries & mutation to individual resource files instead of keeping everything in queries.go file, as queries.go was becoming quite large
  • Add the platform version to the help template in case CLI is connected to Astronomer Software

🎟 Issue(s)

Related #633

🧪 Functional Testing

List the functional testing steps to confirm this feature or fix.

📸 Screenshots

Add screenshots to illustrate the validity of these changes.

📋 Checklist

  • [x] Rebased from the main (or release if patching) branch (before testing)
  • [x] Ran make test before taking out of draft
  • [x] Ran make lint before taking out of draft
  • [x] Added/updated applicable tests
  • [ ] Tested against Astro-API (if necessary).
  • [x] Tested against Houston-API and Astronomer (if necessary).
  • [ ] Communicated to/tagged owners of respective clients potentially impacted by these changes.
  • [ ] Updated any related documentation

neel-astro avatar Aug 26 '22 13:08 neel-astro

Codecov Report

Base: 87.09% // Head: 87.11% // Increases project coverage by +0.02% :tada:

Coverage data is based on head (4f197fd) compared to base (066e35d). Patch coverage: 95.48% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #703      +/-   ##
==========================================
+ Coverage   87.09%   87.11%   +0.02%     
==========================================
  Files         103      106       +3     
  Lines        8949     9083     +134     
==========================================
+ Hits         7794     7913     +119     
- Misses        676      689      +13     
- Partials      479      481       +2     
Impacted Files Coverage Δ
cmd/software/deployment.go 94.32% <ø> (ø)
houston/errors.go 63.63% <0.00%> (-14.15%) :arrow_down:
houston/runtime.go 100.00% <ø> (ø)
houston/websocket.go 66.10% <ø> (ø)
cmd/software/workspace.go 85.59% <60.00%> (-1.37%) :arrow_down:
houston/app.go 84.21% <72.72%> (-15.79%) :arrow_down:
houston/decorator.go 91.93% <91.93%> (ø)
cmd/airflow.go 93.38% <100.00%> (+0.09%) :arrow_up:
cmd/auth.go 89.09% <100.00%> (ø)
cmd/root.go 96.77% <100.00%> (-0.06%) :arrow_down:
... and 27 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Aug 26 '22 13:08 codecov[bot]

@andriisoldatenko can we have a re-review for this PR, have addressed comments from the first review

neel-astro avatar Sep 13 '22 09:09 neel-astro