Skip to content

Docker retag yaml added #1335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Conversation

praveen5959
Copy link
Contributor

@praveen5959 praveen5959 commented Jun 4, 2025

Fixes #XXXX.

Description


This PR has:

  • been tested to ensure log ingestion and log query works.
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added documentation for new or modified features or behaviors.

Summary by CodeRabbit

  • Chores
    • Introduced a new automated workflow to retag Docker images during pull requests, ensuring images are consistently labeled and available for testing.

Copy link
Contributor

coderabbitai bot commented Jun 4, 2025

Walkthrough

A new GitHub Actions workflow file is introduced to automate Docker image retagging on pull requests, excluding those limited to documentation or similar files. The workflow logs into Docker Hub, sets up Docker Buildx, derives a tag from the event, retags the "edge" image, pushes the new tag, and optionally inspects the image.

Changes

File(s) Change Summary
.github/workflows/test-docker-retag.yaml Added a workflow for Docker image retagging and pushing on PRs, excluding docs and related files.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub Actions
    participant Docker Hub

    GitHub Actions->>GitHub Actions: Trigger on PR (excluding docs/assets)
    GitHub Actions->>GitHub Actions: Login to Docker Hub
    GitHub Actions->>GitHub Actions: Setup Docker Buildx
    GitHub Actions->>GitHub Actions: Extract tag from event
    GitHub Actions->>Docker Hub: Pull "edge" image
    GitHub Actions->>GitHub Actions: Retag image with new tag
    GitHub Actions->>Docker Hub: Push new tagged image
    GitHub Actions->>Docker Hub: (Optional) Inspect new image tag
Loading

Poem

🐇
A workflow hops in, swift and neat,
Retagging Docker treats so fleet.
On pull requests it leaps with glee,
Skipping docs and assets, wild and free.
With every tag, a bunny cheer—
Fresh images now appear!


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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

🧹 Nitpick comments (3)
.github/workflows/test-docker-retag.yaml (3)

1-7: Refine docs path-ignore glob pattern

The glob "**.md" may not correctly ignore markdown files in nested directories—use "**/*.md" for comprehensive coverage.

Example diff:

-      - "**.md"
+      - "**/*.md"

33-38: Ensure the 'edge' image is available before retag

docker buildx imagetools create may require the source image locally. Add an explicit pull step before retagging:

+      - name: Pull edge image
+        run: docker pull parseable/parseable:edge

39-42: Guard the optional image inspect step

The inspect step always runs and can fail if the new tag isn't available or the previous step errored. Wrap it with an if: conditional to make it truly optional, for example:

      - name: Inspect new tag (optional)
        if: ${{ always() && steps.meta.outputs.tag }}
        run: |
          docker buildx imagetools inspect parseable/parseable:${{ steps.meta.outputs.tag }}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ad12b8d and e7d559b.

📒 Files selected for processing (1)
  • .github/workflows/test-docker-retag.yaml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: Build Default aarch64-apple-darwin
  • GitHub Check: Build Default x86_64-unknown-linux-gnu
  • GitHub Check: Build Kafka x86_64-unknown-linux-gnu
  • GitHub Check: Build Default x86_64-pc-windows-msvc
  • GitHub Check: Build Default x86_64-apple-darwin
  • GitHub Check: Build Default aarch64-unknown-linux-gnu
  • GitHub Check: Quest Smoke and Load Tests for Distributed deployments
  • GitHub Check: Quest Smoke and Load Tests for Standalone deployments
  • GitHub Check: coverage
🔇 Additional comments (1)
.github/workflows/test-docker-retag.yaml (1)

17-18: Ensure Docker Hub credentials are set

This workflow depends on DOCKER_USERNAME and DOCKER_PASSWORD in repository secrets. Please verify they are configured under Settings → Secrets (or your environment) to avoid authentication failures.

Comment on lines +23 to +30
- name: Extract Tag or SHA
id: meta
run: |
if [[ "${{ github.event_name }}" == "push" ]]; then
TAG_NAME="${GITHUB_REF#refs/tags/}"
else
TAG_NAME="test-pr-${GITHUB_SHA::7}"
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Unreachable 'push' branch in tag extraction

The if [[ "${{ github.event_name }}" == "push" ]] branch will never execute because the workflow only triggers on pull_request. Either add a push trigger or simplify/remove the unused conditional.

🤖 Prompt for AI Agents
In .github/workflows/test-docker-retag.yaml around lines 23 to 30, the
conditional checking if github.event_name is "push" is unreachable because the
workflow triggers only on pull_request events. To fix this, either add a push
trigger to the workflow triggers section to allow the push branch to execute or
simplify the script by removing the conditional and only handling the
pull_request case.

@nitisht
Copy link
Member

nitisht commented Jun 5, 2025

closing in favour of #1336

@nitisht nitisht closed this Jun 5, 2025
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.

2 participants