Skip to content

feat: add dry-run argument for skip pull-request generating#234

Merged
reddevilmidzy merged 1 commit intomainfrom
dry-run
Sep 28, 2025
Merged

feat: add dry-run argument for skip pull-request generating#234
reddevilmidzy merged 1 commit intomainfrom
dry-run

Conversation

@reddevilmidzy
Copy link
Owner

@reddevilmidzy reddevilmidzy commented Sep 28, 2025

♟️ What’s this PR about?

dry-run args를 추가하였습니다.
이제 다음 pr에선 저 코드를 main.rs가 아닌 다른 곳이로 이동 시킬 예정입니다.

🔗 Related Issues / PRs

close: #231

Summary by CodeRabbit

  • New Features
    • Added a dry-run mode (--dry-run / -d) to execute link checks without applying changes, allowing safe previews.
  • Chores
    • Standardized the default author identity used for generated pull requests to a fixed, consistent value.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 28, 2025

Walkthrough

Adds a dry-run CLI flag that gates link-check streaming in main. Modifies PullRequestGenerator by adding a new_content field to FileChange and internalizing default author info, removing corresponding constructor parameters. Tests were adjusted to reflect the new defaults and signature changes.

Changes

Cohort / File(s) Summary
CLI flag and control flow
src/main.rs
Introduces --dry-run/-d flag via Args { dry_run: bool }. Wraps stream_link_checks(args.repo, args.branch).await with a conditional so it runs only when dry_run is true. Error handling remains within the guarded block.
PR generation API changes
src/git/pr_generator.rs
Adds new_content: String to public FileChange. Updates PullRequestGenerator::new(...) to remove author_name and author_email parameters; sets fixed internal defaults for these fields. Tests updated accordingly (constructor usage and expected author values).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant CLI as CLI (main)
  participant Checker as stream_link_checks

  User->>CLI: Run with args (--dry-run / -d)
  alt dry_run == true
    CLI->>Checker: stream_link_checks(repo, branch)
    Checker-->>CLI: Result
    opt error
      CLI-->>User: Print error
    end
  else dry_run == false
    Note over CLI: Skip stream_link_checks
  end
  CLI-->>User: Exit
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Linked Issues Check ⚠️ Warning Issue #231 specifies that enabling dry-run should perform link checks without creating a pull request, but the code only adds the --dry-run flag and conditions the link-checking call, without gating or disabling the PR generation logic. Moreover, changes in pr_generator.rs do not relate to the dry-run objective, and there is no mechanism to skip pull-request creation when dry-run is active. Thus, the core requirement is not fulfilled. Implement logic to bypass or disable the pull-request generation path when dry-run is enabled, and ensure all unrelated pr_generator.rs changes are moved out of this PR to focus solely on the dry-run feature.
Out of Scope Changes Check ⚠️ Warning The modifications to src/git/pr_generator.rs—including adding a new_content field and changing author defaults—are unrelated to the dry-run feature for link checking and PR skipping outlined in issue #231. These alterations lie outside the stated scope and introduce functionality that does not support the dry-run objective. Remove or relocate the pr_generator.rs updates into a separate pull request so that this PR remains focused exclusively on introducing and exercising the dry-run functionality.
✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title “feat: add dry-run argument for skip pull-request generating” directly highlights the addition of a dry-run argument intended to skip pull-request creation, matching the primary feature introduced in this changeset and avoiding extraneous details. It uses the conventional “feat:” prefix and clearly points to the main change from the developer’s perspective. Therefore, it accurately summarizes the core modification.
Description Check ✅ Passed The pull request description follows the repository’s template by providing a “What’s this PR about?” section that summarizes the addition of the dry-run argument and a “Related Issues / PRs” section that correctly references and closes issue #231. Both required headings are present and the content clearly ties back to the intended change. The note on future refactoring is a helpful context but does not detract from covering the current scope.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dry-run

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added this to the 6차 MVP 구현 milestone Sep 28, 2025
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

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 16281a4 and 294868d.

📒 Files selected for processing (2)
  • src/git/pr_generator.rs (3 hunks)
  • src/main.rs (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: reddevilmidzy
PR: reddevilmidzy/queensac#226
File: src/main.rs:21-32
Timestamp: 2025-09-22T15:50:19.531Z
Learning: User reddevilmidzy prefers to communicate in Korean and likes to keep PR scope focused and well-defined.
🧬 Code graph analysis (1)
src/main.rs (1)
src/link_checker/sse.rs (1)
  • stream_link_checks (79-158)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test
🔇 Additional comments (1)
src/git/pr_generator.rs (1)

60-69: 내부 기본 author 설정 👍

생성자에서 author 정보를 일관된 기본값으로 고정해 호출부 시그니처가 단순해졌네요. 팀 표준 커밋 서명을 강제하면서 호출 측 실수를 줄여줄 것 같습니다.

@coveralls-official
Copy link

Pull Request Test Coverage Report for Build 18077226261

Details

  • 3 of 5 (60.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.1%) to 79.804%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/main.rs 0 2 0.0%
Totals Coverage Status
Change from base Build 18077212632: -0.1%
Covered Lines: 897
Relevant Lines: 1124

💛 - Coveralls

@reddevilmidzy reddevilmidzy merged commit ed215ec into main Sep 28, 2025
7 checks passed
@reddevilmidzy reddevilmidzy deleted the dry-run branch September 28, 2025 17:11
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.

dry-run 제공하기

1 participant