Skip to content

Conversation

@germa89
Copy link
Collaborator

@germa89 germa89 commented Jun 16, 2025

Description

Fix migrator secret escaping, PR title and not commenting when re-running

Issue linked

Related to failure to migrate #4009 however I am not sure this should fix it.

Checklist

Summary by Sourcery

Fix secret escaping in the migrator workflow, standardize the migrated PR title format, and limit failure comments to the first run attempt.

CI:

  • Quote the CI bot token to ensure proper secret escaping in the migrator workflow.
  • Standardize the migrated PR title to use the format "migrated (PR #): ".
  • Restrict failure comment creation to only the first workflow run to avoid duplicates on retries.

@germa89 germa89 requested a review from a team as a code owner June 16, 2025 10:44
@germa89 germa89 self-assigned this Jun 16, 2025
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jun 16, 2025

Reviewer's Guide

This PR refines the GitHub Actions migrator workflow by properly escaping the CI token secret, updating the mirrored PR title format, and preventing duplicate failure comments on retries.

Flow diagram for updated migrator workflow steps in GitHub Actions

flowchart TD
    A[Start Migration Job] --> B[Use github-script with properly escaped secret token]
    B --> C[Create mirrored PR with updated title format]
    C --> D{Migration Success?}
    D -- Yes --> E[End]
    D -- No --> F{Is this the first run attempt?}
    F -- Yes --> G[Create failure comment]
    F -- No --> H[Skip failure comment]
    G --> E
    H --> E
Loading

File-Level Changes

Change Details Files
Properly escape the CI token in the workflow
  • Wrapped ${{ secrets.PYANSYS_CI_BOT_TOKEN }} in quotes for consistent parsing
.github/workflows/migrator.yml
Reformat migrated PR title
  • Changed title template from chore: [migrated PR X] … to migrated (PR X): …
.github/workflows/migrator.yml
Prevent duplicate failure comments on reruns
  • Added github.run_attempt == 1 guard to failure comment step
.github/workflows/migrator.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@ansys-reviewer-bot
Copy link
Contributor

Thanks for opening a Pull Request. If you want to perform a review write a comment saying:

@ansys-reviewer-bot review

@github-actions github-actions bot added CI/CD Related with CICD, Github Actions, etc maintenance General maintenance of the repo (libraries, cicd, etc) bug Issue, problem or error in PyMAPDL labels Jun 16, 2025
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 @germa89 - I've reviewed your changes and they look great!


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 and I'll use the feedback to improve your reviews.

@germa89
Copy link
Collaborator Author

germa89 commented Jun 16, 2025

@pyansys-ci-bot LGTM.

@germa89 germa89 enabled auto-merge (squash) June 16, 2025 15:12
Copy link
Contributor

@pyansys-ci-bot pyansys-ci-bot left a comment

Choose a reason for hiding this comment

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

✅ Approving this PR because germa89 said so in here 😬

LGTM

@germa89 germa89 merged commit 0eb827a into main Jun 16, 2025
80 of 83 checks passed
@germa89 germa89 deleted the ci/improvements-to-migrator branch June 16, 2025 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue, problem or error in PyMAPDL CI/CD Related with CICD, Github Actions, etc maintenance General maintenance of the repo (libraries, cicd, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants