Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Fix issue where you can't disable Project polling #2673

Merged
merged 2 commits into from
Nov 4, 2021

Conversation

catsby
Copy link
Contributor

@catsby catsby commented Nov 3, 2021

Currently with waypoint project apply, users need to provide several flags in order to enable git or app status polling. Two flags are problematic (flagPoll and flagAppStatusPoll) because they are declared as bool values, and our flag parsing package cannot discern between a false boolean value supplied versus the zero value false if either flag is simply omitted. That, coupled with a logical truthy check, currently prevent users from turning either polling or app status polling off with the CLI once they are enabled (users can still disable git polling from the UI).

This PR adds a new flag value BoolPtrVar, for boolean values that need to discern between true,false, and omitted. BoolPtrVar is a *bool value which contains a pointer to true, false, or nil. There is no default value (or you could say nil is the default). This enables users to omit the flag and not have that be interpreted as supplying false.

Fixes #2037
Supersedes #2610

@catsby catsby added the pr/no-changelog No automatic changelog entry required for this pull request label Nov 3, 2021
@github-actions github-actions bot added the core label Nov 3, 2021
@catsby
Copy link
Contributor Author

catsby commented Nov 3, 2021

Thanks @evanphx for teaching me the pointer magic here :D

@catsby catsby requested a review from a team November 3, 2021 22:12
@catsby catsby added core/cli and removed pr/no-changelog No automatic changelog entry required for this pull request labels Nov 3, 2021
Copy link
Member

@briancain briancain left a comment

Choose a reason for hiding this comment

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

Nice, this looks really clean! 👏🏻

@catsby catsby merged commit ef38f97 into main Nov 4, 2021
@catsby catsby deleted the project-apply-booleans branch November 4, 2021 15:07
@briancain
Copy link
Member

Should this have been backported @catsby ? You can still backport by applying the label once it's merged, if so.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot disable project data source polling with CLI
3 participants