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

Print provider config in provider get, if any #3881

Merged
merged 1 commit into from
Jul 12, 2024

Conversation

jhrozek
Copy link
Contributor

@jhrozek jhrozek commented Jul 12, 2024

Summary

We used to only print provider config if there was any on provider get. That's not very user-friendly in case the user enables
auto-registration and then runs provider get to see what had changed.

In the usual case where there's no config, we don't print anything. If
there is configuration, we print key-value pairs for each config option.

The key-value pairs work fine for now since we have a low number of
config options. In the future, once our config gets more complicated, we
should just switch to printing the config as YAML, but for now this
looks awkward and the table gets too vertically long for just one
option.

Fixes: #3816

Change Type

  • Bug fix (resolves an issue without affecting existing features)
  • Feature (adds new functionality without breaking changes)
  • Breaking change (may impact existing functionalities or require documentation updates)
  • Documentation (updates or additions to documentation)
  • Refactoring or test improvements (no bug fixes or new functionality)

Testing

minder provider update --set-attribute=auto_registration.entities.repository.enabled=false --name=github-app-jakubtestorg
minder provider get -n github-app-jakubtestorg

Review Checklist:

  • Reviewed my own code for quality and clarity.
  • Added comments to complex or tricky code sections.
  • Updated any affected documentation.
  • Included tests that validate the fix or feature.
  • Checked that related changes are merged.

We used to only print provider config if there was any on `provider
get`. That's not very user-friendly in case the user enables
auto-registration and then runs provider get to see what had changed.

In the usual case where there's no config, we don't print anything. If
there is configuration, we print key-value pairs for each config option.

The key-value pairs work fine for now since we have a low number of
config options. In the future, once our config gets more complicated, we
should just switch to printing the config as YAML, but for now this
looks awkward and the table gets too vertically long for just one
option.

Fixes: mindersec#3816
@jhrozek jhrozek requested a review from a team as a code owner July 12, 2024 14:45
@coveralls
Copy link

Coverage Status

coverage: 53.053% (+0.005%) from 53.048%
when pulling 9840bdc on jhrozek:provider_get_show_config
into 41e4833 on stacklok:main.

@jhrozek jhrozek merged commit 6a66082 into mindersec:main Jul 12, 2024
22 checks passed
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.

Provide a mechanism to show attributes in provider get
3 participants