Skip to content

Conversation

@hrntknr
Copy link
Member

@hrntknr hrntknr commented Aug 23, 2025

Summary

This PR improves the Docker image tagging strategy to better align with release workflows and reduce unnecessary image builds. The changes ensure that semantic version tags and the 'latest' tag are only applied during official releases, while removing PR-specific tagging that was creating redundant images.

Type of Change

  • fix: A bug fix
  • feat: A new feature
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • refactor: A code change that neither fixes a bug nor adds a feature
  • perf: A code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to our CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit

Changes Made

  • Removed PR-specific tagging (type=ref,event=pr,prefix=pr-) to avoid unnecessary image builds on every PR
  • Added semantic versioning tags that only trigger on release events:
    • {{version}} (e.g., 1.2.3)
    • {{major}}.{{minor}} (e.g., 1.2)
    • {{major}} (e.g., 1)
  • Restricted latest tag to only apply when releases are published instead of on every main branch push
  • All version-related tags now only activate when github.event_name == 'release' and github.event.action == 'published'

Benefits

  • Reduces Docker registry storage by eliminating redundant PR images
  • Provides proper semantic versioning for releases
  • Ensures latest tag truly represents the latest stable release
  • Maintains branch-based tagging for development builds

Related Issues

- Remove PR-specific tagging to reduce unnecessary image builds
- Add semantic versioning tags (major, minor, patch) for releases
- Restrict 'latest' tag to only releases instead of main branch pushes
- Add version-specific tags only when releases are published
Copilot AI review requested due to automatic review settings August 23, 2025 19:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refines the Docker image tagging strategy to optimize for official releases and reduce unnecessary builds. The changes shift from PR-based tagging to semantic versioning patterns that only activate during release events, ensuring better alignment with production workflows.

  • Removes PR-specific tagging to eliminate redundant image builds
  • Introduces semantic versioning tags (version, major.minor, major) for releases
  • Restricts the 'latest' tag to only apply during published releases

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +44 to +47
type=semver,pattern={{version}},enable=${{ github.event_name == 'release' && github.event.action == 'published' }}
type=semver,pattern={{major}}.{{minor}},enable=${{ github.event_name == 'release' && github.event.action == 'published' }}
type=semver,pattern={{major}},enable=${{ github.event_name == 'release' && github.event.action == 'published' }}
type=raw,value=latest,enable=${{ github.event_name == 'release' && github.event.action == 'published' }}
Copy link

Copilot AI Aug 23, 2025

Choose a reason for hiding this comment

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

The enable condition ${{ github.event_name == 'release' && github.event.action == 'published' }} is repeated across multiple lines (44-47). Consider extracting this into a variable or environment variable to improve maintainability and reduce duplication.

Suggested change
type=semver,pattern={{version}},enable=${{ github.event_name == 'release' && github.event.action == 'published' }}
type=semver,pattern={{major}}.{{minor}},enable=${{ github.event_name == 'release' && github.event.action == 'published' }}
type=semver,pattern={{major}},enable=${{ github.event_name == 'release' && github.event.action == 'published' }}
type=raw,value=latest,enable=${{ github.event_name == 'release' && github.event.action == 'published' }}
type=semver,pattern={{version}},enable=${{ env.RELEASE_PUBLISHED }}
type=semver,pattern={{major}}.{{minor}},enable=${{ env.RELEASE_PUBLISHED }}
type=semver,pattern={{major}},enable=${{ env.RELEASE_PUBLISHED }}
type=raw,value=latest,enable=${{ env.RELEASE_PUBLISHED }}

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Aug 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@hrntknr hrntknr merged commit 37bbe8c into sigbit:main Aug 23, 2025
8 checks passed
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.

1 participant