Skip to content

feat: add optional preprod preview URL to PR comments#73

Open
souhaibparcellab wants to merge 1 commit intomainfrom
feat/add-preprod-preview-url-option
Open

feat: add optional preprod preview URL to PR comments#73
souhaibparcellab wants to merge 1 commit intomainfrom
feat/add-preprod-preview-url-option

Conversation

@souhaibparcellab
Copy link

Add PREPROD_PREVIEW_ENABLED input parameter that allows applications to include preprod preview URL in the PR comment. This is opt-in and defaults to false to maintain backward compatibility.

@souhaibparcellab souhaibparcellab requested a review from a team as a code owner February 5, 2026 09:38
Copilot AI review requested due to automatic review settings February 5, 2026 09:38
@github-actions github-actions bot added the ci label Feb 5, 2026
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 adds an optional feature to include a preprod preview URL in PR comments for applications that have preprod preview environments. The change is opt-in via a new boolean input parameter that defaults to false, ensuring backward compatibility with existing workflows.

Changes:

  • Add PREPROD_PREVIEW_ENABLED boolean input parameter (defaults to false)
  • Introduce a new build step to construct the PR comment message dynamically based on the parameter value
  • Refactor the PR commenting logic to use the dynamically built message

@@ -87,9 +92,20 @@ jobs:
if: ${{ inputs.GHA_TRIGGER_EVENT != 'synchronize' }}
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The comment-pr job is missing required permissions to comment on pull requests. The thollander/actions-comment-pull-request action requires pull-requests: write permission. Add a permissions block to this job similar to what exists in other workflows (e.g., pr.yaml:21-23).

Suggested change
if: ${{ inputs.GHA_TRIGGER_EVENT != 'synchronize' }}
if: ${{ inputs.GHA_TRIGGER_EVENT != 'synchronize' }}
permissions:
pull-requests: write

Copilot uses AI. Check for mistakes.
id: build-message
run: |
MESSAGE="Preview URL: https://${{ inputs.APPLICATION_NAME }}-preview-${{ inputs.PR_NUMBER }}.staging.parcellab.dev"
if [ "${{ inputs.PREPROD_PREVIEW_ENABLED }}" == "true" ]; then
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

Use single equals sign for string comparison to be consistent with the established convention in this codebase. See kubernetes.yaml:206 which uses the pattern if [ "$VAR" = "true" ]; then for boolean string comparison.

Copilot uses AI. Check for mistakes.
Comment on lines +100 to +104
MESSAGE="${MESSAGE}
Preview URL (preprod): https://${{ inputs.APPLICATION_NAME }}-preprod-preview-${{ inputs.PR_NUMBER }}.staging.parcellab.dev"
fi
MESSAGE="${MESSAGE}
Preview Argo App: https://argocd.staging.parcellab.dev/applications/argocd/${{ inputs.APPLICATION_NAME }}-preview-${{ inputs.PR_NUMBER }}"
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The multiline string concatenation includes leading whitespace that will appear in the PR comment. The indentation before "Preview URL (preprod)" on line 101 will be preserved in the output. Consider removing the leading spaces to ensure consistent formatting of the PR comment, or ensure this indentation is intentional.

Suggested change
MESSAGE="${MESSAGE}
Preview URL (preprod): https://${{ inputs.APPLICATION_NAME }}-preprod-preview-${{ inputs.PR_NUMBER }}.staging.parcellab.dev"
fi
MESSAGE="${MESSAGE}
Preview Argo App: https://argocd.staging.parcellab.dev/applications/argocd/${{ inputs.APPLICATION_NAME }}-preview-${{ inputs.PR_NUMBER }}"
MESSAGE="${MESSAGE}"$'\n'"Preview URL (preprod): https://${{ inputs.APPLICATION_NAME }}-preprod-preview-${{ inputs.PR_NUMBER }}.staging.parcellab.dev"
fi
MESSAGE="${MESSAGE}"$'\n'"Preview Argo App: https://argocd.staging.parcellab.dev/applications/argocd/${{ inputs.APPLICATION_NAME }}-preview-${{ inputs.PR_NUMBER }}"

Copilot uses AI. Check for mistakes.
Add PREPROD_PREVIEW_ENABLED input parameter that allows applications
to include preprod preview URL in the PR comment. This is opt-in
and defaults to false to maintain backward compatibility.
@souhaibparcellab souhaibparcellab force-pushed the feat/add-preprod-preview-url-option branch from 4c15bdd to f23bb82 Compare February 5, 2026 09:46
Copy link
Contributor

@kpplis kpplis left a comment

Choose a reason for hiding this comment

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

@souhaibparcellab preprod word should be a part of APPLICATION_NAME input rather than constitute a special case in the reusable workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants