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

Add a new endpoint to unreserve a path #1468

Merged
merged 1 commit into from
Mar 19, 2019

Conversation

benthorner
Copy link
Contributor

https://trello.com/c/6s9Bhzyj/632-delete-publishing-api-path-reservations-when-we-discard-drafts

This adds a new command to unreserve (destroy) a PathReservation,
provided the reservation exists and matches the given publishing app.

@benthorner benthorner requested a review from kevindew March 15, 2019 17:14
@benthorner benthorner force-pushed the add-unreserve-path-endpoint branch 2 times, most recently from 10e4845 to 90b8275 Compare March 15, 2019 17:22
Copy link
Member

@kevindew kevindew left a comment

Choose a reason for hiding this comment

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

Looks good, just a minor issue

let(:request_body) { payload.to_json }

def do_request(body: request_body, headers: {})
delete request_path, params: body, headers: headers
Copy link
Member

Choose a reason for hiding this comment

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

ooh TIL - did not realise request_path could be in scope here

fail.
- If a path reservation exists for the supplied base_path but a different
publishing_app, the command will fail.

Copy link
Member

Choose a reason for hiding this comment

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

Nice one doing this 👍


context "when the path is not owned by the app" do
it "returns an error" do
payload = { base_path: "/bar" }
Copy link
Member

Choose a reason for hiding this comment

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

This test looks a bit like it's testing what happens when a required parameter is missing rather than owned by a different app.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair enough - I was being minimal. Amended :-).

@benthorner benthorner force-pushed the add-unreserve-path-endpoint branch from 90b8275 to f0f7207 Compare March 15, 2019 18:00
@cbaines
Copy link
Contributor

cbaines commented Mar 18, 2019

What's the motivation for this change? It would be good if you could add that to the commit message.

This adds a new command to unreserve (destroy) a PathReservation,
provided the reservation exists and matches the given publishing app.

As we migrate formats from Whitehall to Content Publisher, users
sometimes need to revert to Whitehall if certain features aren't
available. Because Whitehall assumes it is authoritative for all paths
in a format, we need to be able to cleanup the Publishing API in order
for the user to re-create their content in Whitehall and re-use a path.
@benthorner benthorner force-pushed the add-unreserve-path-endpoint branch from f0f7207 to 8014783 Compare March 18, 2019 10:34
@benthorner
Copy link
Contributor Author

@cbaines sure, I've updated the commit - the Trello card on this PR should also give more context :-).

@cbaines
Copy link
Contributor

cbaines commented Mar 18, 2019

@cbaines sure, I've updated the commit - the Trello card on this PR should also give more context :-).

Great, thanks. Scary, but still good to know.

@benthorner benthorner merged commit 2ee53bc into master Mar 19, 2019
@benthorner benthorner deleted the add-unreserve-path-endpoint branch March 19, 2019 11:10
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.

3 participants