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

meta(crons): Update API help text #58048

Merged
merged 5 commits into from
Oct 16, 2023
Merged

meta(crons): Update API help text #58048

merged 5 commits into from
Oct 16, 2023

Conversation

rjo100
Copy link
Contributor

@rjo100 rjo100 commented Oct 12, 2023

Updates API help text for Crons validators

Follow up from #57885
Closes #58051

@rjo100 rjo100 requested a review from a team as a code owner October 12, 2023 22:45
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 12, 2023
class MonitorValidator(CamelSnakeSerializer, PreventNumericSlugMixin):
project = ProjectField(scope="project:read")
name = serializers.CharField(max_length=128)
name = serializers.CharField(
max_length=128, help_text="Name of the monitor. Used for notifications."
Copy link
Member

Choose a reason for hiding this comment

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

nit: Let's slap a magic trailing comma at the end so it's consistent with the other fields?

)
status = serializers.ChoiceField(
choices=list(zip(MONITOR_STATUSES.keys(), MONITOR_STATUSES.keys())),
default="active",
help_text="One of [active, disabled]. Disabled monitors do not generate events or notifications.",
Copy link
Member

Choose a reason for hiding this comment

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

I think the API spec already shows the options, let's leave it off of the help text since we would have to keep it in sync otherwise.

Copy link
Member

Choose a reason for hiding this comment

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

I wonder if it's possible to create documentation for the enums themselves?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

isn't that it right here

image

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah right was looking in the wrong place

help_text="Duration of the job run, in milliseconds.",
)
environment = serializers.CharField(
required=False, allow_null=True, help_text="Name of the environment."
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
required=False, allow_null=True, help_text="Name of the environment."
required=False,
allow_null=True,
help_text="Name of the environment.",

@@ -288,7 +292,7 @@ class ContextsValidator(serializers.Serializer):
trace = TraceContextValidator(required=False)


@extend_schema_serializer(exclude_fields=["duration", "environment", "monitor_config", "contexts"])
@extend_schema_serializer(exclude_fields=["monitor_config", "contexts"])
class MonitorCheckInValidator(serializers.Serializer):
status = serializers.ChoiceField(
Copy link
Member

Choose a reason for hiding this comment

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

No help text on status?

@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

Merging #58048 (71e4def) into master (f33a3f7) will decrease coverage by 0.01%.
Report is 12 commits behind head on master.
The diff coverage is 100.00%.

❗ Current head 71e4def differs from pull request most recent head e545c39. Consider uploading reports for the commit e545c39 to get more accurate results

@@            Coverage Diff             @@
##           master   #58048      +/-   ##
==========================================
- Coverage   79.03%   79.02%   -0.01%     
==========================================
  Files        5130     5130              
  Lines      223044   223045       +1     
  Branches    37560    37562       +2     
==========================================
- Hits       176276   176270       -6     
- Misses      41135    41141       +6     
- Partials     5633     5634       +1     
Files Coverage Δ
src/sentry/monitors/validators.py 92.35% <100.00%> (ø)

... and 14 files with indirect coverage changes

@rjo100 rjo100 merged commit 650777e into master Oct 16, 2023
49 of 50 checks passed
@rjo100 rjo100 deleted the rjo100/fix-api-meta branch October 16, 2023 21:36
@github-actions github-actions bot locked and limited conversation to collaborators Nov 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Crons API to be aligned with new enterprise spec
2 participants