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

main.py: cards: get right version from abs_url #271

Closed
wants to merge 5 commits into from

Conversation

adriendupuis
Copy link
Contributor

@adriendupuis adriendupuis commented Feb 19, 2024

Question Answer
JIRA Ticket N/A
Versions All
Edition All

Bug example:
https://doc.ibexa.co/projects/userguide/en/4.5/persona_paths/author_content/ "Edit image"
In persona_paths/author_content.md, content_management/edit_images/ refers to 4.5 file which doesn't exist on master or 4.6 (moved to image_management/edit_images/).

Bug origin: The canonical_url is always on latest (4.6) so cards may compute a wrong cross-version URL (404).

Bug fix: use abs_url to get the right version. doesn't work: on 4.5 prod, version still equals latest.

Checklist

  • Text renders correctly
  • Text has been checked with vale
  • Description metadata is up to date
  • Redirects cover removed/moved pages
  • Added link to this PR in relevant JIRA ticket or code PR

main.py Outdated Show resolved Hide resolved
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

idea Catch issues before they fail your Quality Gate with our IDE extension SonarLint SonarLint

main.py Outdated
Comment on lines 49 to 50
url_parts = re.search("//([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/", canonical)
(site, project, edition, language, version) = url_parts.groups()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

site is not really useful. Those two lines should be removed, and site removed below from the rebuilt URLs passed to the cards.

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@adriendupuis
Copy link
Contributor Author

See #288

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.

1 participant