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

exempt miraheze.org from RDNS checks; update domains_as_tlds #3866

Merged
merged 5 commits into from
Jun 9, 2024

Conversation

MacFan4000
Copy link
Sponsor Member

@MacFan4000 MacFan4000 commented Jun 8, 2024

I think we can safely assume that miraheze.org will always be correctly pointed to Miraheze. This fixes the RDNS alerts due to cloudflare.

also adds liao.media to domains_as_tlds to fix another alert (NS set for subdomain, not root).

Summary by CodeRabbit

  • New Features
    • Exempted the domains liao.media and miraheze.org from reverse DNS checks, enhancing compatibility for these domains.
  • Bug Fixes
    • Improved error handling for specific domain exemptions in reverse DNS checks.
  • Chores
    • Added a directive to suppress mypy errors in key management scripts.

I think we can safely assume that miraheze.org will always be correctly pointed to Miraheze. This fixes the RDNS alerts due to cloudflare.

also adds liao.media to domains_as_tlds to fix another alert (NS set for subdomain, not root).
Copy link
Contributor

coderabbitai bot commented Jun 8, 2024

Walkthrough

The recent updates involve adjustments to reverse DNS checks and error handling in check_reverse_dns.py, including exemptions for specific domains. Additionally, a directive was added to keys.py to suppress mypy errors. These changes enhance the robustness and flexibility of DNS monitoring and simplify error management during static type checking.

Changes

File Change Summary
.../monitoring/files/check_reverse_dns.py Added 'liao.media' to domains_as_tlds, modified error handling to exempt certain domains, and added a specific exemption for miraheze.org.
.../salt/files/keys.py Added # mypy: ignore-errors directive to suppress mypy errors.

Poem

In code we trust, with changes neat,
Domains exempt, a tidy feat.
DNS checks now more refined,
Errors handled, peace of mind.
Mypy silenced, keys aligned,
Our system’s path, clearly defined.


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@MacFan4000
Copy link
Sponsor Member Author

CI failure has nothing to do with my change

RhinosF1 and others added 2 commits June 8, 2024 21:32
Exempt from mypy, not our code
@RhinosF1
Copy link
Contributor

RhinosF1 commented Jun 8, 2024

@coderabbitai review

Copy link
Contributor

@RhinosF1 RhinosF1 left a comment

Choose a reason for hiding this comment

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

Could we not exit a bit earlier in the process? Would be a bit more optimal.

@MacFan4000
Copy link
Sponsor Member Author

@coderabbitai review

Copy link
Contributor

coderabbitai bot commented Jun 8, 2024

Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1d346d5 and bace5fb.

Files selected for processing (2)
  • modules/monitoring/files/check_reverse_dns.py (2 hunks)
  • modules/salt/files/keys.py (1 hunks)
Files skipped from review due to trivial changes (1)
  • modules/salt/files/keys.py
Additional context used
Ruff
modules/monitoring/files/check_reverse_dns.py

129-129: f-string without any placeholders (F541)

Additional comments not posted (1)
modules/monitoring/files/check_reverse_dns.py (1)

62-62: The addition of 'liao.media' to domains_as_tlds aligns with the PR objectives and is correctly implemented.

modules/monitoring/files/check_reverse_dns.py Outdated Show resolved Hide resolved
Copy link
Contributor

coderabbitai bot commented Jun 8, 2024

Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

MacFan4000 and others added 2 commits June 8, 2024 16:44
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@MacFan4000
Copy link
Sponsor Member Author

@coderabbitai full review

Copy link
Contributor

coderabbitai bot commented Jun 8, 2024

Actions performed

Full review triggered.

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: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1d346d5 and cc96cab.

Files selected for processing (2)
  • modules/monitoring/files/check_reverse_dns.py (2 hunks)
  • modules/salt/files/keys.py (1 hunks)
Additional comments not posted (6)
modules/salt/files/keys.py (4)

1-1: The addition of the mypy: ignore-errors directive is appropriate for handling dynamic typing in SaltStack.


Line range hint 11-29: The accept function is well-implemented with appropriate error handling and logging.


Line range hint 31-47: The status function correctly handles different states of a minion's key and provides clear status updates.


Line range hint 49-69: The delete function is correctly implemented, with comprehensive checks and appropriate logging for missing keys.

modules/monitoring/files/check_reverse_dns.py (2)

Line range hint 98-123: The get_reverse_dnshostname function is robust, with comprehensive error handling and clear exit points for different failure modes.


62-62: Adding 'liao.media' to domains_as_tlds addresses specific DNS configuration issues.

Verification successful

The search results show that domains_as_tlds is only used within the modules/monitoring/files/check_reverse_dns.py file. This indicates that adding 'liao.media' to domains_as_tlds does not affect other parts of the codebase.

  • modules/monitoring/files/check_reverse_dns.py:
    • Line defining domains_as_tlds
    • Line checking if root_domain is in domains_as_tlds
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that adding 'liao.media' to domains_as_tlds does not affect other functionalities.

# Test: Search for other usages of `domains_as_tlds`. Expect: No unexpected impacts.
rg --type python $'domains_as_tlds'

Length of output: 65



Script:

#!/bin/bash
# Description: Verify that adding 'liao.media' to domains_as_tlds does not affect other functionalities.

# Test: Search for other usages of `domains_as_tlds`. Expect: No unexpected impacts.
rg 'domains_as_tlds' --glob '*.py'

Length of output: 220

modules/monitoring/files/check_reverse_dns.py Show resolved Hide resolved
@redbluegreenhat redbluegreenhat merged commit 4a8c957 into miraheze:master Jun 9, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants