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

Set EXTERNAL_DOCS setting for OpenAPI spec #13430

Merged
merged 9 commits into from
Jan 16, 2025

Conversation

walpox
Copy link
Contributor

@walpox walpox commented Jan 5, 2025

Proposed changes

  • Set the EXTERNAL_DOCS setting for the OpenAPI document.

Checklist

  • Lint and unit tests pass locally with my changes.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added documentation to describe my feature.
  • I have squashed my commits into logic units.
  • I have described the changes in the commit messages.

Other information

Relates to #12584

walpox added 4 commits January 5, 2025 01:18
Make returning the home page of the documentation more consistent with
existing code logic and with clearer intent, improving code readability.
@nijel nijel added this to the 5.10 milestone Jan 5, 2025
@nijel nijel self-assigned this Jan 13, 2025
@nijel nijel enabled auto-merge (squash) January 13, 2025 08:09
auto-merge was automatically disabled January 13, 2025 11:31

Head branch was pushed to by a user without write access

@walpox
Copy link
Contributor Author

walpox commented Jan 13, 2025

The merge conflict has been resolved and the PR should be good to go now.

@@ -9,6 +9,8 @@

from django.utils.translation import gettext_lazy

from weblate.utils.docs import get_doc_url
Copy link
Member

Choose a reason for hiding this comment

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

Unfortunately, this won't work because get_doc_url relies on settings and get_spectacular_settings is called from settings. In the end, Django fails to load the settings and fails with weird errors like you can see in the test suite.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have changed it so that EXTERNAL_DOCS uses a hardcoded URL to the home page of documentation. I don't know how to fix this issue properly in a timely manner, and don't want to delay release for your milestone...

The changes to get_doc_url have also been reverted.

Copy link
Member

Choose a reason for hiding this comment

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

Using lazy evaluation might work, but it depends on when this setting is actually used.

@walpox walpox marked this pull request as draft January 13, 2025 16:16
@walpox walpox changed the title Update get_doc_url function and set EXTERNAL_DOCS setting for OpenAPI spec Set EXTERNAL_DOCS setting for OpenAPI spec Jan 13, 2025
@walpox walpox force-pushed the walpox/add-api-external-docs branch from 029918c to da753e6 Compare January 13, 2025 17:49
@walpox walpox force-pushed the walpox/add-api-external-docs branch from da753e6 to 5c44349 Compare January 13, 2025 17:49
@walpox walpox marked this pull request as ready for review January 14, 2025 13:52
@nijel nijel merged commit c443322 into WeblateOrg:main Jan 16, 2025
33 checks passed
nijel added a commit to nijel/weblate that referenced this pull request Jan 16, 2025
nijel added a commit that referenced this pull request Jan 16, 2025
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.

3 participants