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

catalog-backend: add support for static location config + bootstrap location #1890

Merged
merged 2 commits into from
Aug 12, 2020

Conversation

Rugvip
Copy link
Member

@Rugvip Rugvip commented Aug 10, 2020

Fixes #1833

Tried 3 different implementations of this, this is the least ugly one ._.

So this adds a processor that reads a 'bootstrap' location, of which there always exists one, and it can be used to bootstrap other work.

I tried implementing this as a decorator for the LocationCatalog, as you can do more validation of that locations are allowed to be added with that. But that falls apart because the locations aren't added to the database, and entities has a foreign key constraint on the location id.

Another option was to do something similar to this, but use a statically added location entity instead. This felt slightly more clean though.

Overall I ran into a bunch of issues because of the existence of LocationIds, and would want to explore if we could completely promote all kinds of locations to entities, and then also get rid of the IDs.

I also noticed the slightly awkward fact that it's the registered location in the database that shows up as the managed-by location, even when emitting a location entity that is then read to collect more entities. It's again due to the location id being a requirement, and emitted locations don't receive any ID.

@freben freben merged commit 359594f into master Aug 12, 2020
@freben freben deleted the rugvip/static-loc branch August 12, 2020 12:57
@andrewthauer
Copy link
Collaborator

@Rugvip - There might be an issue with this migration and postgres. I started seeing this error:

migration file "20200809202832_add_bootstrap_location.js" failed
migration failed with error: insert into "locations" ("id", "target", "type") values ($1, $2, $3) - invalid input syntax for type uuid: "bootstrap"

@Rugvip
Copy link
Member Author

Rugvip commented Aug 13, 2020

@andrewthauer yep, fixed by #1935

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.

RFC: Support static configuration of catalog location entries
3 participants