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: fixed issue with missing chapter content on Juno hero page #195

Merged
merged 2 commits into from
Sep 15, 2024

Conversation

TeKrop
Copy link
Owner

@TeKrop TeKrop commented Sep 15, 2024

Summary by Sourcery

Fix the issue with missing chapter content on the Juno hero page by updating the parsing logic and adjusting the URL path format for hero pages. Update test cases to align with these changes.

Bug Fixes:

  • Fix issue with missing chapter content on the Juno hero page by adjusting the parsing logic to include additional HTML tags.

Enhancements:

  • Ensure hero URLs are correctly formatted by removing redundant slashes in the path construction.

Tests:

  • Update test cases to reflect the corrected hero URL path format, ensuring consistency with the new URL structure.

@TeKrop TeKrop added the bug Something isn't working label Sep 15, 2024
@TeKrop TeKrop self-assigned this Sep 15, 2024
Copy link
Contributor

sourcery-ai bot commented Sep 15, 2024

Reviewer's Guide by Sourcery

This pull request addresses an issue with missing chapter content on the Juno hero page. The changes primarily involve updating URL paths and improving the parsing of hero data. The modifications ensure correct URL construction, proper data extraction, and consistent handling of hero information across the application.

File-Level Changes

Change Details Files
Updated URL path construction for hero pages
  • Modified the hero_path setting to include a trailing slash
  • Updated the get_blizzard_url method to append a trailing slash after the hero_key
  • Adjusted cache key generation to reflect the new URL structure
app/config.py
app/parsers/hero_parser.py
tests/commands/test_check_and_update_cache.py
Improved hero data parsing and extraction
  • Added support for parsing 'pr' tags in addition to 'p' tags when extracting story chapters
  • Applied strip() to remove leading/trailing whitespace from the hero's location
app/parsers/hero_parser.py
Updated test cases to reflect changes in URL structure
  • Modified cache key strings in various test functions to include the trailing slash
  • Adjusted expected URL formats in test assertions
tests/commands/test_check_and_update_cache.py

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @TeKrop - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Could you provide more context on why the 'pr' tag was added to the list of tags to find when collecting paragraphs in the __get_story_chapters method? Understanding the reason behind this change would be helpful.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟡 Testing: 1 issue found
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@@ -47,7 +47,7 @@ def test_check_and_update_gamemodes_cache_to_update(
settings.expired_cache_refresh_limit + 30,
)
cache_manager.update_parser_cache(
f"HeroParser-{settings.blizzard_host}/{locale}{settings.heroes_path}/ana",
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion (testing): Update test cases to reflect changes in URL structure

The changes in the URL structure (removing a slash before 'ana' and adding one after) are consistently applied across multiple test cases. This is good for maintaining consistency, but we should ensure that these changes align with the actual behavior of the updated code.

Suggested change
f"HeroParser-{settings.blizzard_host}/{locale}{settings.heroes_path}/ana",
f"HeroParser-{settings.blizzard_host}/{locale}{settings.heroes_path}/ana",

Copy link

sonarcloud bot commented Sep 15, 2024

@TeKrop TeKrop merged commit 5e9d333 into main Sep 15, 2024
3 checks passed
@TeKrop TeKrop deleted the bugfix/juno-hero-page-chapter-content branch September 15, 2024 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant