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

license: refactor license check to be agnostic of input #2659

Merged
merged 7 commits into from
Dec 1, 2023

Conversation

msanft
Copy link
Contributor

@msanft msanft commented Nov 29, 2023

Context

We want to refactor the apply command to strictly separate the logic working with user interaction (to the cli package) and the "business logic", which is agnostic of wether it's called from the CLI (to the internal/constellation package) in preparation for the Terraform provider.

Proposed change(s)

  • Refactor the license check to not consume a file handler by default and only check the license in it, regardless of where it comes from.
  • Move all user-I/O code to a separate function in the constellation apply command in the CLI.

Additional info

Checklist

  • Add labels (e.g., for changelog category)
  • Is PR title adequate for changelog?
  • Link to Milestone

@msanft msanft added the no changelog Change won't be listed in release changelog label Nov 29, 2023
@msanft msanft added this to the v2.14.0 milestone Nov 29, 2023
Copy link

netlify bot commented Nov 29, 2023

Deploy Preview for constellation-docs canceled.

Name Link
🔨 Latest commit eef7d02
🔍 Latest deploy log https://app.netlify.com/sites/constellation-docs/deploys/6568adab4940100008a4361e

@msanft msanft marked this pull request as ready for review November 29, 2023 13:04
@msanft msanft requested a review from thomasten as a code owner November 29, 2023 13:04
cli/internal/cmd/apply.go Outdated Show resolved Hide resolved
@msanft
Copy link
Contributor Author

msanft commented Nov 29, 2023

New E2E Test

@msanft msanft requested a review from thomasten November 29, 2023 15:54
internal/constellation/apply.go Outdated Show resolved Hide resolved
@msanft msanft requested a review from thomasten November 30, 2023 15:43
Copy link
Member

@thomasten thomasten left a comment

Choose a reason for hiding this comment

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

Thanks :)

Copy link
Contributor

Coverage report

Package Old New Trend
cli/internal/cmd 58.60% 58.50% ↘️
internal/constellation [no test files] [no test files] 🚧
internal/license 83.30% 81.80% ↘️

@msanft msanft merged commit 4d6a7fa into main Dec 1, 2023
8 checks passed
@msanft msanft deleted the feat/constellation-lib/apply-backend branch December 1, 2023 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog Change won't be listed in release changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants