Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Anselmoo
Copy link
Owner

@Anselmoo Anselmoo commented May 20, 2025

… for 'Anselmoo/spectrafit'

All PR-Submissions:


  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open
    Pull Requests for the same
    update/change?

New ✨✨ Feature-Submissions:


  • Does your submission pass tests?
  • Have you lint your code locally prior to submission? Fixed:
  • This PR is for a new feature, not a bug fix.

Changes to ⚙️ Core-Features:


  • Have you added an explanation of what your changes do and why you'd like
    us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully run tests with your changes locally?

Summary by Sourcery

Enhance GitHub Actions by restricting runs to the main repository, unifying naming conventions with emojis for improved readability, introduce a GitLab mirroring workflow, and adjust existing workflows (dependency updates, CI, CD) accordingly.

New Features:

  • Add a new GitLab mirroring workflow to sync the repository with GitLab.

Enhancements:

  • Add if: github.repository == 'Anselmoo/spectrafit' guards to CI jobs to prevent them from running on forks.
  • Standardize workflow and step names with emojis and consistent prefixes across all GitHub Actions.
  • Rename the weekly dependency update workflow from Poetry to UV and improve PR creation logging.

CI:

  • Update workflow names and job names to include descriptive emojis.
  • Refactor step titles for clarity, adding icons to checkout, setup, build, test, and deploy steps.

@semanticdiff-com
Copy link

semanticdiff-com bot commented May 20, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  .github/workflows/pylint.yml  68% smaller
  .github/workflows/python-ci.yml  68% smaller
  .github/workflows/docker-ci.yml  60% smaller
  .github/workflows/release-cd.yml  58% smaller
  .github/workflows/update-changelog.yaml  57% smaller
  .github/workflows/labeler.yml  56% smaller
  .github/workflows/codeql.yml  56% smaller
  .github/workflows/greetings.yml  54% smaller
  .github/workflows/conda-check.yml  49% smaller
  .github/workflows/weekly-uv-bot.yml  48% smaller
  .github/workflows/dependency-review.yml  45% smaller
  .github/workflows/docker-cd.yml  45% smaller
  .github/workflows/devcontainer-ci.yml  20% smaller
  .github/workflows/gitlab-mirror.yml  0% smaller
  .github/workflows/release-drafter.yml  0% smaller

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented May 20, 2025

Reviewer's Guide

This PR updates CI workflows by adding repository-specific guards and emoji-enhanced naming to existing jobs, and introduces a new GitLab mirror workflow to push branches, tags, and PR source branches to a GitLab mirror.

File-Level Changes

Change Details Files
Restrict workflows to the main repository
  • Add if: github.repository == 'Anselmoo/spectrafit' guard to jobs
  • Ensure CI jobs only run on the primary repo
.github/workflows/python-ci.yml
.github/workflows/update-changelog.yml
.github/workflows/weekly-uv-bot.yml
.github/workflows/docker-cd.yml
.github/workflows/docker-ci.yml
.github/workflows/codeql.yml
.github/workflows/conda-check.yml
.github/workflows/release-cd.yml
.github/workflows/pylint.yml
.github/workflows/greetings.yml
.github/workflows/devcontainer-ci.yml
.github/workflows/dependency-review.yml
.github/workflows/labeler.yml
.github/workflows/release-drafter.yml
Standardize job and step naming with emoji prefixes
  • Prefix job names with relevant emojis
  • Add emojis to step names for visual clarity
.github/workflows/python-ci.yml
.github/workflows/update-changelog.yml
.github/workflows/weekly-uv-bot.yml
.github/workflows/docker-cd.yml
.github/workflows/docker-ci.yml
.github/workflows/codeql.yml
.github/workflows/conda-check.yml
.github/workflows/release-cd.yml
.github/workflows/pylint.yml
.github/workflows/greetings.yml
.github/workflows/devcontainer-ci.yml
.github/workflows/dependency-review.yml
.github/workflows/labeler.yml
.github/workflows/release-drafter.yml
Add GitLab mirroring workflow
  • Introduce gitlab-mirror.yml with checkout, remote configuration, and push logic
  • Handle branches, tags, and pull request sources for mirroring
.github/workflows/gitlab-mirror.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

@github-actions github-actions bot added the github-actions Pull requests that update Github_actions code label May 20, 2025
@codecov
Copy link

codecov bot commented May 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (c3d5cfa) to head (8bc1fff).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1905   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           63        63           
  Lines         5882      5882           
=========================================
  Hits          5882      5882           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pull-request-size pull-request-size bot added size/L and removed size/M labels May 20, 2025
@Anselmoo Anselmoo marked this pull request as ready for review May 20, 2025 15:02
@Anselmoo Anselmoo enabled auto-merge (squash) May 20, 2025 15:02
@sonarqubecloud
Copy link

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 @Anselmoo - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 4 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.

Comment on lines +32 to +34
if [ -z "$GITLAB_USERNAME" ] || [ -z "$GITLAB_TOKEN" ] || [ -z "$GITLAB_PROJECT_PATH" ]; then
echo "❌ Error: Missing required GitLab credentials or project path."
echo "Please set GITLAB_USERNAME, GITLAB_TOKEN, and GITLAB_PROJECT_PATH secrets."
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Secret validation only checks for presence, not for empty values.

Add checks to ensure each secret is not only set but also non-empty to prevent the script from proceeding with empty values.

Suggested change
if [ -z "$GITLAB_USERNAME" ] || [ -z "$GITLAB_TOKEN" ] || [ -z "$GITLAB_PROJECT_PATH" ]; then
echo "❌ Error: Missing required GitLab credentials or project path."
echo "Please set GITLAB_USERNAME, GITLAB_TOKEN, and GITLAB_PROJECT_PATH secrets."
# Ensure secrets are provided and non-empty (not just set)
if [ -z "${GITLAB_USERNAME// }" ] || [ -z "${GITLAB_TOKEN// }" ] || [ -z "${GITLAB_PROJECT_PATH// }" ]; then
echo "❌ Error: Missing or empty GitLab credentials or project path."
echo "Please ensure GITLAB_USERNAME, GITLAB_TOKEN, and GITLAB_PROJECT_PATH are set and non-empty."

# Add GitLab remote with credentials
echo "📝 Adding GitLab remote..."
GITLAB_URL="https://${GITLAB_USERNAME}:${GITLAB_TOKEN}@${GITLAB_HOSTNAME}/${GITLAB_PROJECT_PATH}.git"
git remote add gitlab "${GITLAB_URL}"
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (bug_risk): No check for existing 'gitlab' remote before adding.

Verify if a 'gitlab' remote already exists and remove or update it before adding, to prevent failures on reruns.

echo "🔄 Processing pull request #$PR_NUMBER from $SOURCE_BRANCH to $TARGET_BRANCH"

# Check if PR source branch exists locally
if git show-ref --verify --quiet "refs/remotes/origin/$SOURCE_BRANCH"; then
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (bug_risk): PR source branch check may not work for forks.

The 'refs/remotes/origin/$SOURCE_BRANCH' check skips forked PRs since their branches aren’t local. Ensure fork branches are fetched or handled.

fi
else
echo "🆕 Branch $CURRENT_BRANCH does not exist on GitLab. Creating it..."
git push gitlab "$CURRENT_BRANCH"
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion (bug_risk): Initial branch push does not handle protected branches.

Catch push failures when the GitLab branch is protected or restricted and provide clear error messages.

@Anselmoo Anselmoo disabled auto-merge May 20, 2025 15:17
@Anselmoo Anselmoo merged commit 1826742 into main May 20, 2025
63 of 64 checks passed
@Anselmoo Anselmoo deleted the feature/update branch May 20, 2025 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github-actions Pull requests that update Github_actions code size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant