Add --monitor-policy flag to app-create and app-update commands#93
Merged
asafgabai merged 7 commits intoJul 23, 2026
Merged
Conversation
Introduce an optional --monitor-policy flag (format: "type=<type>[, value=<n>]") that maps to the AppTrust monitor_policy configuration on the create and update application requests. Supported types: none, time_frame_in_months, version_count; value is required for the enabled types and must be omitted for none. Co-authored-by: Cursor <cursoragent@cursor.com>
Move the monitor-policy parsing/validation into a utils helper and handle it inline in populateApplicationFromFlags, matching the other flag fields. Remove non-conventional comments. Co-authored-by: Cursor <cursoragent@cursor.com>
Cover version_count and time_frame_in_months on create, and time_frame_in_months, version_count, and none on update, verifying the persisted policy via the applications GET endpoint. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
asafgabai
reviewed
Jul 23, 2026
asafgabai
reviewed
Jul 23, 2026
asafgabai
reviewed
Jul 23, 2026
asafgabai
reviewed
Jul 23, 2026
asafgabai
reviewed
Jul 23, 2026
- Reword --monitor-policy flag description for clarity - Unit-test ParseMonitorPolicyFlag cases in utils_test.go - Replace dedicated monitor-policy tests with samples in existing create/update tests - Remove intPtr/IntPtr helpers in favor of local variables Co-authored-by: Cursor <cursoragent@cursor.com>
asafgabai
reviewed
Jul 23, 2026
asafgabai
approved these changes
Jul 23, 2026
…licy description Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--monitor-policyflag tojf apptrust app-createandjf apptrust app-update, mapping to the AppTrustmonitor_policyconfiguration on the create/update application requests."type=<type>[, value=<n>]". Supported types:none,time_frame_in_months,version_count.valuemust be a positive integer and is required for the enabled types, and must be omitted whentype=none.app-create, omitting the flag leaves monitoring off; onapp-update, omitting it leaves the current policy unchanged (omitempty).AppDescriptormodel with aMonitorPolicytype/field and validation inpopulateApplicationFromFlags.Usage
Test plan
app-createcovering all types, missing/invalid/non-positive value, missing type, invalid type, and unknown fields.app-updateflag-suite cases (with value,type=none, invalid type).go test ./apptrust/commands/application/...passes; no lint errors.Made with Cursor