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

Use content id aliases over content ids for embedded content #2916

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Gweaton
Copy link
Contributor

@Gweaton Gweaton commented Oct 15, 2024

Trello card

Changes in this PR

This is a first attempt at updating Embedded Content-facing code to read human-readable Content ID Aliases rather than UUID Content IDs, meaning users can assign meaningful names to embedded content.

It's a large diff, and can probably be slightly better committed to help with reviewing and prevent tests from failing.

I'm sure there are some improvements we can make to this, but as we're potentially pivoting onto other work, I'm pushing this currently working draft for future reference.

Known TODOs:

  • Update EmbeddedContentSpec to use ContentIDAliases
  • In tests, be consistent about whether we're using Edition.content_id or edition.document.content_id
  • Do we need to update Presenters::Queries::EmbeddedContentPresenter ?
  • Would tests be improved/simplified by adding a transient factory parameter to an Edition to create a content_id_alias without us having to specify one everywhere?
  • Add an integration test for creating a new ContentIDAlias when PUTting a contact.

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

This application is owned by the publishing platform team. Please let us know in #govuk-publishing-platform when you raise any PRs.

Follow these steps if you are doing a Rails upgrade.

rather than content_id.

Now that we're storing a `ContentIdAlias` in Publishing API's
database with a `name`, we can allow users to enter this and look
up existing `ContentIdAlias`es by this value.
@Gweaton Gweaton changed the base branch from main to create-friendly-ids-on-put October 15, 2024 10:53
Base automatically changed from create-friendly-ids-on-put to main October 15, 2024 12:23
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.

1 participant