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 feature gate for preflight permissions #1666

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

bentito
Copy link
Contributor

@bentito bentito commented Jan 29, 2025

Description

Allows this work to be done behind a feature gate, allowing for testing and for the code to settle in before it starts affecting operations.

Name of the feature gate is, PreflightPermissions, see code and tests for usage.

Should be a no-op even if enabled, as there is currently no code behind it.

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

@bentito bentito requested a review from a team as a code owner January 29, 2025 20:05
Copy link

netlify bot commented Jan 29, 2025

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit c688acd
🔍 Latest deploy log https://app.netlify.com/sites/olmv1/deploys/679bf7c45140c2000824a21d
😎 Deploy Preview https://deploy-preview-1666--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@bentito bentito requested a review from trgeiger January 29, 2025 20:05
Copy link

codecov bot commented Jan 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.43%. Comparing base (158d974) to head (2b92859).
Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1666      +/-   ##
==========================================
+ Coverage   67.42%   67.43%   +0.01%     
==========================================
  Files          55       57       +2     
  Lines        4632     4622      -10     
==========================================
- Hits         3123     3117       -6     
+ Misses       1284     1278       -6     
- Partials      225      227       +2     
Flag Coverage Δ
e2e 53.15% <0.00%> (-0.15%) ⬇️
unit 54.34% <100.00%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bentito
Copy link
Contributor Author

bentito commented Jan 29, 2025

/test upgrade-e2e

Copy link

openshift-ci bot commented Jan 29, 2025

@bentito: No presubmit jobs available for operator-framework/operator-controller@main

In response to this:

/test upgrade-e2e

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 30, 2025
Copy link
Contributor

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

/hold cancel

To ensure we maintain our DX goals, I think we should add at least one check here.

Comment link

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 30, 2025
@bentito
Copy link
Contributor Author

bentito commented Jan 30, 2025

To ensure we maintain our DX goals, I think we should add at least one check here.

What is DX? Dev Experience? I don't see how that's relevant.

For this to be a problem for a user, they have to 1) find out how to enable a feature gated item, 2) have some expectation of what enabling that feature would do. That seems unlikely without documenting the flag, which will come later.

The reason this PR is helpful to merge is that it allows other contributing devs to use the flag. There are lots of other ways that other devs could learn about and use this flag, but merging this PR is a straightforward manner, one that doesn't assume how the devs will communicate and share info.

As soon as a dev uses the flag there will be at least one check hidden behind the flag.

Signed-off-by: Brett Tofel <[email protected]>
@camilamacedo86
Copy link
Contributor

Hi @bentito

As discussed, we can add the option LockToDefault: true than, my concern #1666 (comment) is sorted out! Thank you !

)

var operatorControllerFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
// Add new feature gate definitions
// Ex: SomeFeature: {...}
PreflightPermissions: {Default: false, PreRelease: featuregate.Alpha},
Copy link
Contributor

Choose a reason for hiding this comment

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

It is missing LockToDefault: true

Copy link
Contributor Author

Choose a reason for hiding this comment

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

making it PreAlpha to settle all (most?) concerns

PreflightPermissions: {
Default: false,
PreRelease: featuregate.PreAlpha, // keep this PreAlpha until done with feature development
LockToDefault: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

Should not be true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we set LockToDefault to true, @ankitathomas reports that you cannot access the feature-gated code for testing by then setting the emulated version. So LockToDefault true would render it untestable.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we do not set it true:

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