Skip to content

feat(nimbus): Add validation for Firefox Labs fields#13313

Merged
freshstrangemusic merged 1 commit intomainfrom
push-ynktywxtupml
Aug 20, 2025
Merged

feat(nimbus): Add validation for Firefox Labs fields#13313
freshstrangemusic merged 1 commit intomainfrom
push-ynktywxtupml

Conversation

@freshstrangemusic
Copy link
Member

Because:

  • Firefox Labs fields were originally behind the Django admin panel and not user-editable and thus we decided not to add validation to the NimbusReviewSerializer at implementation time;
  • we have completed the UI migration to htmx and we now have Firefox Labs fields that are user-editable;
  • these fields were added without adding validation to the NimbusReviewSerializer, thus making it possible to create and launch invalid Firefox Labs rollouts;
  • the firefox_labs_description_links field was defined as a JSON field in the model, but the UI was defined as a text field, leading to differences between the serialized and saved data; and
  • we were saving the NimbusExperiment multiple times in NimbusBranchesForm.save()

this commit:

  • adds validation to the NimbusReviewSerializer for Firefox Labs fields;
  • migrates the firefox_labs_description_links field to a TextField; and
  • adds a NimbusBranchesForm.clean() to enforce that all Firefox Labs deliveries are rollouts.

Fixes #13304

Copy link
Collaborator

@jaredlockhart jaredlockhart left a comment

Choose a reason for hiding this comment

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

Looking good! Thnx I don't know how I missed adding the validation around this 🙈

Some questions and thoughts but generally looks right 🙏

@freshstrangemusic freshstrangemusic force-pushed the push-ynktywxtupml branch 4 times, most recently from daf2d57 to 6320be6 Compare August 20, 2025 16:10
Copy link
Collaborator

@jaredlockhart jaredlockhart left a comment

Choose a reason for hiding this comment

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

Yep looking good.

Seems like we're throwing a validation error that's not being displayed, maybe the review serializer isn't hooked up to all the fields in the template:
Screenshot 2025-08-20 at 12-54-01 asdf - Branches Experimenter

@freshstrangemusic freshstrangemusic force-pushed the push-ynktywxtupml branch 2 times, most recently from e721e34 to 18b3656 Compare August 20, 2025 17:30
@freshstrangemusic freshstrangemusic force-pushed the push-ynktywxtupml branch 2 times, most recently from cea3d42 to cee8b26 Compare August 20, 2025 17:43
Copy link
Collaborator

@jaredlockhart jaredlockhart left a comment

Choose a reason for hiding this comment

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

Okey doke, tested locally, everything looks good, tests are good, thnx @freshstrangemusic 🙏 🎉

@freshstrangemusic freshstrangemusic force-pushed the push-ynktywxtupml branch 2 times, most recently from 608cb65 to ea1cc9d Compare August 20, 2025 18:32
Because:

- Firefox Labs fields were originally behind the Django admin panel and
  not user-editable and thus we decided not to add validation to the
  `NimbusReviewSerializer` at implementation time;
- we have completed the UI migration to htmx and we now have Firefox
  Labs fields that are user-editable;
- these fields were added without adding validation to the
  `NimbusReviewSerializer`, thus making it possible to create and launch
  invalid Firefox Labs rollouts;
- the `firefox_labs_description_links` field was defined as a JSON field
  in the model, but the UI was defined as a text field, leading to
  differences between the serialized and saved data; and
- we were saving the NimbusExperiment multiple times in
  `NimbusBranchesForm.save()`

this commit:

- adds validation to the `NimbusReviewSerializer` for Firefox Labs
  fields;
- migrates the `firefox_labs_description_links` field to a `TextField`;
  and
- adds a `NimbusBranchesForm.clean()` to enforce that all Firefox Labs
  deliveries are rollouts.

Fixes #13304
@freshstrangemusic freshstrangemusic added this pull request to the merge queue Aug 20, 2025
Merged via the queue into main with commit 7de436e Aug 20, 2025
16 checks passed
@freshstrangemusic freshstrangemusic deleted the push-ynktywxtupml branch August 20, 2025 19:20
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.

Firefox Labs fields are not validated

2 participants