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

fix: allow empty appName as it may come in the url #3953

Merged
merged 2 commits into from
Jun 12, 2023

Conversation

gastonfournier
Copy link
Contributor

@gastonfournier gastonfournier commented Jun 11, 2023

About the changes

Edit application under https://app.unleash-hosted.com/demo/applications/test-app is currently not working as the appName is expected to come in the request body, but it's actually part of the url. We have two options here:

  1. We change the UI to adapt to the expectations of the request by adding appName to the request body (and eventually removing appName from the URL, which would be a breaking change)
  2. We remove the restriction of only sending the appName in the body and take the one that comes in the URL. We have a validation that verifies that at least one of the two sets the appName (here we validate using this schema)

In terms of REST API, we can assume that the appName will be present in the resource /api/admin/metrics/applications (an endpoint we don't have), but when we're updating an application we should refer to that application by its URL: /api/admin/metrics/applications/<appName> and the presence of an appName in the body might indicate that we're trying to change the name of the application (something we currently not support)

Based on the above, I believe going with the second option is best, as it adheres to REST principles and does not require a breaking change. Despite that, we only support updating applications as the creation is done from metrics ingestion

Fixes: #3580

@vercel
Copy link

vercel bot commented Jun 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Jun 11, 2023 3:27pm
unleash-monorepo-frontend ⬜️ Ignored (Inspect) Jun 11, 2023 3:27pm

Copy link
Contributor

@chriswk chriswk left a comment

Choose a reason for hiding this comment

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

Nice catch Gaston. 👍

@gastonfournier gastonfournier merged commit 4e0678d into main Jun 12, 2023
10 checks passed
@gastonfournier gastonfournier deleted the fix-upsert-application branch June 12, 2023 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

"Edit application" page fails validation
2 participants