Skip to content

Conversation

germa89
Copy link
Collaborator

@germa89 germa89 commented May 29, 2025

Description

Fixing errors highlighted in #3972

Issue linked

Close #3972

Checklist

Summary by Sourcery

Fix errors in the migrator workflow by standardizing string interpolation, enhancing logging, and updating branch merge logic with conflict detection

CI:

  • Use template literals and quote event mode logs for workflow_dispatch and issue_comment inputs
  • Add colorized informational echo statements for remote, fetch, checkout, pull, and merge steps
  • Update merge sequence to pull the head branch, merge the main branch into the base branch, and detect merge conflicts

@germa89 germa89 requested a review from a team as a code owner May 29, 2025 16:31
@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

Copy link
Contributor

sourcery-ai bot commented May 29, 2025

Reviewer's Guide

This PR refines the migrator workflow by standardizing string interpolation and logging, and by overhauling the branch merge procedure to include pulling from the head repo, merging in main, and detecting conflicts.

File-Level Changes

Change Details Files
Standardize event metadata extraction and interpolation
  • Switched core.info messages to use double-quoted strings with embedded quotes
  • Replaced single-quoted literal assignments with backtick template literals for inputs
  • Applied changes in both workflow_dispatch and issue_comment branches
.github/workflows/migrator.yml
Enhance shell logging with colored [INFO] tags
  • Prepended ANSI escape codes to echo statements
  • Standardized '[INFO]' prefix across add-remote, fetch, checkout, pull, and merge steps
.github/workflows/migrator.yml
Overhaul merge strategy and add conflict detection
  • Replaced direct git merge of head branch with pull from head and merge of origin/main
  • Removed old merge command and inserted git pull head_repo
  • Introduced git ls-files -u count and echo reporting for conflicts
.github/workflows/migrator.yml

Assessment against linked issues

Issue Objective Addressed Explanation
#3972 The workflow migrator should correctly parse the comment body, even if there is additional text in the comment.
#3972 The workflow migrator should update the target branch to avoid merge conflicts.
#3972 The workflow migrator should update before opening the PR.

Possibly linked issues


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

@germa89 germa89 self-assigned this May 29, 2025
@germa89 germa89 requested a review from RobPasMue May 29, 2025 16:32
@github-actions github-actions bot added CI/CD Related with CICD, Github Actions, etc maintenance General maintenance of the repo (libraries, cicd, etc) labels May 29, 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 - here's some feedback:

  • The ANSI escape codes for colored logs may not render correctly in GitHub Actions and can clutter output—consider removing them or using the built-in log grouping and annotation features.
  • Verify that merging 'origin/main' into the PR branch is the intended workflow; you might want to parameterize the base branch name instead of hardcoding 'main' for broader flexibility.
Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: 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 and I'll use the feedback to improve your reviews.

Copy link
Member

@RobPasMue RobPasMue left a comment

Choose a reason for hiding this comment

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

LGTM!

@germa89 germa89 enabled auto-merge (squash) May 30, 2025 09:05
@germa89
Copy link
Collaborator Author

germa89 commented May 30, 2025

@pyansys-ci-bot LGTM.

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 disabled auto-merge May 30, 2025 09:06
@germa89
Copy link
Collaborator Author

germa89 commented May 30, 2025

Before merging, can you @RobPasMue review the last commit?? cf85214

Asking @ansys/pyansys-core for another review or look.

Pinging @jorgepiloto @klmcadams @moe-ad for awareness.

Copy link

codecov bot commented May 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.26%. Comparing base (cce7ad1) to head (a29cccb).
Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3973   +/-   ##
=======================================
  Coverage   88.25%   88.26%           
=======================================
  Files         187      187           
  Lines       14935    14935           
=======================================
+ Hits        13181    13182    +1     
+ Misses       1754     1753    -1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@germa89 germa89 enabled auto-merge (squash) May 30, 2025 12:22
@germa89 germa89 merged commit b8a2bed into main Jun 2, 2025
50 checks passed
@germa89 germa89 deleted the ci/update-branch-in-migrator branch June 2, 2025 09:49
@clatapie clatapie mentioned this pull request Jun 3, 2025
10 tasks
@germa89 germa89 mentioned this pull request Jun 23, 2025
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

Workflow migrator issues
5 participants