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

refactor: implement workaround for id replacement queries #74

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

shreddedbacon
Copy link
Member

A lot of queries in the API require the project ID, not the name. This is a work around to implement queries that support the name as an input instead of the ID by doing a veryMinimalProjectByName request before performing the actual query/mutation.

Previously the lagoon-cli would do a minimalProjectByName query before some requests to get the project ID without the user having to remember it, but this requests the openshift ID which organization owners currently can't see, so rather than break the query in machinery, this implements a new lightweight veryMinimalProjectByName which is internal to machinery only.

Ideally, the API would get updated to have name in requests instead of id, but this way when the API eventually does support it, these new functions can just be refactored to use the updated API instead of doing the veryMinimalProjectByName request first. The organization owner/admin role should also be updated to be able to view which openshift a project is configured to use, but again that would take time to implement, where machinery is quicker for now.

@shreddedbacon shreddedbacon merged commit dbf215d into main Oct 15, 2024
@shreddedbacon shreddedbacon deleted the named-requests branch October 15, 2024 07:06
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.

2 participants