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 no changelog API response #5064

Merged
merged 3 commits into from
May 7, 2024
Merged

Fix no changelog API response #5064

merged 3 commits into from
May 7, 2024

Conversation

mdegat01
Copy link
Contributor

@mdegat01 mdegat01 commented May 6, 2024

Proposed change

The status code of the changelog API when an addon had no changelog was accidently chnaged in #4972 . This PR changes it back to a 200 in this case and adds a unit test. It also fixes the /store/addons/{slug}/changelog API as it appears that hasn't worked for a long time (frontend is still using the supposedly deprecated /addons/{slug}/changelog and that did work).

As an aside this feels very hacky. We should simply return a 404 and the frontend should have the text to display in that case with localization. Supervisor should not be returning the message presented directly to users in this case.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to the supervisor)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Ruff (ruff format supervisor tests)
  • Tests have been added to verify that the new code works.

If API endpoints of add-on configuration are added/changed:

@mdegat01 mdegat01 added the bugfix A bug fix label May 6, 2024
@mdegat01 mdegat01 requested review from agners and pvizeli May 6, 2024 21:12
Copy link
Member

@sairon sairon left a comment

Choose a reason for hiding this comment

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

Thanks, it's downfall of this change to be precise. I will take a look if it's the only place that relied on this rather weird handling but this PR fixes the issue, so 👍

tests/api/test_store.py Outdated Show resolved Hide resolved
tests/api/test_store.py Show resolved Hide resolved
Co-authored-by: Stefan Agner <stefan@agner.ch>
tests/api/test_store.py Outdated Show resolved Hide resolved
Co-authored-by: Jan Čermák <sairon@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Supervisor JSON DECODE client error for add-ons without ChangeLog
3 participants