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

fixes bug in md mdx format adjuster.py #2698

Open
wants to merge 4 commits into
base: develop-postgres
Choose a base branch
from

Conversation

IITI-tushar
Copy link

@IITI-tushar IITI-tushar commented Jan 8, 2025

What kind of change does this PR introduce?

bugfix
Issue Number:#2685

Fixes #2685
Did you add tests for your changes?

Snapshots/Videos:

If relevant, did you update the documentation?

Summary

Does this PR introduce a breaking change?

Other information

Have you read the contributing guide?

yes

Summary by CodeRabbit

  • Refactor
    • Removed MDX character escaping logic from documentation processing workflow
    • Simplified documentation processing script

Copy link
Contributor

coderabbitai bot commented Jan 8, 2025

Walkthrough

The pull request involves modifying the talawa_mobile_md_mdx_format_adjuster.py script by removing the escape_mdx_characters function. This change eliminates the previous mechanism for escaping special characters in Dart documentation. The process_file function no longer calls this function, indicating a shift in how MDX character handling is approached in the script.

Changes

File Change Summary
.github/workflows/talawa_mobile_md_mdx_format_adjuster.py Removed escape_mdx_characters function and its invocation in process_file

Assessment against linked issues

Objective Addressed Explanation
Fix escaping of HTML tags in markdown [#2685]

Poem

🐰 A rabbit's tale of code so bright,
Escaped characters took flight
No more backslashes to constrain
MDX now flows without a chain
Freedom for tags, both big and small! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

github-actions bot commented Jan 8, 2025

Our Pull Request Approval Process

Thanks for contributing!

Testing Your Code

Remember, your PRs won't be reviewed until these criteria are met:

  1. We don't merge PRs with poor code quality.
    1. Follow coding best practices such that CodeRabbit.ai approves your PR.
  2. We don't merge PRs with failed tests.
    1. When tests fail, click on the Details link to learn more.
    2. Write sufficient tests for your changes (CodeCov Patch Test). Your testing level must be better than the target threshold of the repository
    3. Tests may fail if you edit sensitive files. Ask to add the ignore-sensitive-files-pr label if the edits are necessary.
  3. We cannot merge PRs with conflicting files. These must be fixed.

Our policies make our code better.

Reviewers

Do not assign reviewers. Our Queue Monitors will review your PR and assign them.
When your PR has been assigned reviewers contact them to get your code reviewed and approved via:

  1. comments in this PR or
  2. our slack channel

Reviewing Your Code

Your reviewer(s) will have the following roles:

  1. arbitrators of future discussions with other contributors about the validity of your changes
  2. point of contact for evaluating the validity of your work
  3. person who verifies matching issues by others that should be closed.
  4. person who gives general guidance in fixing your tests

Other

🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/workflows/talawa_mobile_md_mdx_format_adjuster.py (1)

79-79: Document the rationale for disabling MDX character escaping

The removal of this processing step should be documented in the code. Please add a comment explaining:

  1. Why the MDX character escaping was removed
  2. How special characters are expected to be handled now
  3. Any potential impact on the documentation pipeline
-    # content = escape_mdx_characters(content)
+    # MDX character escaping removed because:
+    # <explanation of why it's no longer needed and how special characters are handled>
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b5b49cb and e02d9bf.

📒 Files selected for processing (1)
  • .github/workflows/talawa_mobile_md_mdx_format_adjuster.py (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Testing codebase
  • GitHub Check: Testing build for iOS
  • GitHub Check: Testing build for android
🔇 Additional comments (2)
.github/workflows/talawa_mobile_md_mdx_format_adjuster.py (2)

Line range hint 21-79: Add tests to verify documentation processing

Since this script is part of the documentation workflow, please add tests to verify:

  1. The documentation still builds successfully without MDX character escaping
  2. Special characters in markdown files are handled correctly
  3. The documentation renders properly in Docusaurus

This will help prevent potential regressions in the documentation pipeline.

Would you like me to help create a test plan or open a GitHub issue to track this task?


21-42: Verify if removing MDX character escaping is intentional

The removal of the escape_mdx_characters function might lead to MDX parsing errors if special characters (<, >, {, }) appear in the documentation. Since this function was specifically designed for Docusaurus v3 compatibility, please:

  1. Confirm if this removal is the intended fix for issue Bug Report: talawa_mobile_md_mdx_format_adjuster.script escapes HTML tags in markdown file. #2685
  2. Verify if these special characters are being handled differently now
  3. Test the documentation build to ensure no MDX parsing errors occur
✅ Verification successful

Removal of MDX character escaping is the correct fix

The removal of escape_mdx_characters function is the intended fix for issue #2685. The function was incorrectly escaping HTML tags and type parameters in the documentation, which prevented proper rendering in Docusaurus. These special characters are part of valid documentation syntax and should not be escaped.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for potential MDX parsing issues in markdown files
# Look for unescaped special characters in .md files that might cause MDX parsing errors

echo "Checking for potential MDX parsing issues..."

# Search for unescaped special characters in markdown files
rg --type md '(?<!\\)[<>{}]' || echo "No unescaped special characters found"

Length of output: 432


Script:

#!/bin/bash
# Get issue details and search for MDX-related files and patterns

# Fetch issue details
echo "=== Issue #2685 Details ==="
gh issue view 2685 || echo "Unable to fetch issue"

echo -e "\n=== Searching for MDX special characters ==="
# Search with simpler patterns and PCRE2
rg --pcre2 '[<>{}]' --type md || echo "No special characters found"

echo -e "\n=== Checking for documentation config ==="
fd -e json -e js docusaurus || echo "No Docusaurus config found"

Length of output: 80266

Copy link

codecov bot commented Jan 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.55%. Comparing base (b5b49cb) to head (e02d9bf).

Additional details and impacted files
@@                Coverage Diff                @@
##           develop-postgres    #2698   +/-   ##
=================================================
  Coverage             96.55%   96.55%           
=================================================
  Files                   189      189           
  Lines                  9994     9994           
=================================================
  Hits                   9650     9650           
  Misses                  344      344           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Cioppolo14 Cioppolo14 requested review from CyberWake and removed request for palisadoes January 8, 2025 13:12
@Cioppolo14
Copy link
Contributor

@IITI-tushar Please do not assign reviewers when submitting a PR, as mentioned in the github action message above: Reviewers
Do not assign reviewers. Our Queue Monitors will review your PR and assign them.
When your PR has been assigned reviewers contact them to get your code reviewed and approved via:

comments in this PR or
our slack channel

@noman2002
Copy link
Member

@IITI-tushar Please attach a screenshot or video.

@IITI-tushar
Copy link
Author

IITI-tushar commented Jan 10, 2025

@noman2002 look at this commit commit made by Sir Peter Harrison @palisadoes when he comment out the script. Then i asked @gautam-divyanshu to run the workflow and he has done this commit commit-by-divyanshu in which the issue get solved.

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