Page MenuHomePhabricator

Allow "almanac.service.edit" to create services
ClosedPublic

Authored by epriestley on Apr 9 2018, 9:20 PM.
Tags
None
Referenced Files
F13085243: D19318.diff
Wed, Apr 24, 11:45 PM
Unknown Object (File)
Mon, Apr 22, 8:22 PM
Unknown Object (File)
Fri, Apr 19, 7:03 AM
Unknown Object (File)
Fri, Apr 19, 2:51 AM
Unknown Object (File)
Wed, Apr 17, 6:47 PM
Unknown Object (File)
Mar 8 2024, 4:24 PM
Unknown Object (File)
Mar 5 2024, 2:07 PM
Unknown Object (File)
Jan 13 2024, 3:10 PM
Subscribers
None

Details

Summary

Depends on D19317. Ref T13120. Ref T12414. See PHI145. See PHI473.

This adds a Conduit-only "type" transaction for Almanac services. This is very similar to the approach in D18849 for Drydock blueprints.

Test Plan
  • Tried to create an empty service via "almanac.service.edit", was told to pick a type.
  • Tried to pick a bad type, was told to pick a good type.
  • Created a new Almanac service via "almanac.service.edit".
  • Tried to edit the service to change the type, wasn't allowed to.
  • Created and edited via the web UI, nothing changed from before.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

amckinley added inline comments.
src/applications/almanac/editor/AlmanacServiceEditEngine.php
46–52

Do we care about validating that someone doesn't pass in two type transactions that disagree with each other? I'm not too bothered about this "last type transaction wins" implementation, but I wanted to make sure it was intentional.

src/applications/almanac/xaction/AlmanacServiceNameTransaction.php
19

Ugh, I saw this in the other diff and thought it looked wrong...

This revision is now accepted and ready to land.Apr 9 2018, 11:32 PM
src/applications/almanac/editor/AlmanacServiceEditEngine.php
46–52

We allow multiple edits of the same type as long as they're each individually valid, and then combine them before applying them, and remove them if they have no effect.

This ends up sort of weird for edits like "set title to X" + "set title to Y" since the "set title to X" transaction completely vanishes, but for edits like "Add subscriber A" + "Add subscriber B" or "Add comment X" + "Add comment Y" the behavior is more sensible, and then I think it's good that we apply the same rule to "set title to..." that we apply to other transactions.

This revision was automatically updated to reflect the committed changes.