diff --git a/.github/workflows/ci-tests-e2e-forks.yaml b/.github/workflows/ci-tests-e2e-forks.yaml index 3aaeccb30..3e34c846d 100644 --- a/.github/workflows/ci-tests-e2e-forks.yaml +++ b/.github/workflows/ci-tests-e2e-forks.yaml @@ -6,9 +6,6 @@ on: workflows: ['CI: Tests E2E'] types: [requested, completed] -env: - DATE_FORMAT: '+%m/%d/%Y, %I:%M:%S %p' - jobs: deploy-and-comment-forked-pr: runs-on: ubuntu-latest @@ -63,8 +60,7 @@ jobs: ./scripts/cicd/pr-playwright-deploy-and-comment.sh \ "${{ steps.pr.outputs.result }}" \ "${{ github.event.workflow_run.head_branch }}" \ - "starting" \ - "$(date -u '${{ env.DATE_FORMAT }}')" + "starting" - name: Download and Deploy Reports if: steps.pr.outputs.result != 'null' && github.event.action == 'completed' diff --git a/.github/workflows/ci-tests-e2e.yaml b/.github/workflows/ci-tests-e2e.yaml index 34d24f7f0..60400f9a0 100644 --- a/.github/workflows/ci-tests-e2e.yaml +++ b/.github/workflows/ci-tests-e2e.yaml @@ -182,10 +182,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v6 - - name: Get start time - id: start-time - run: echo "time=$(date -u '+%m/%d/%Y, %I:%M:%S %p')" >> $GITHUB_OUTPUT - - name: Post starting comment env: GITHUB_TOKEN: ${{ github.token }} @@ -194,8 +190,7 @@ jobs: ./scripts/cicd/pr-playwright-deploy-and-comment.sh \ "${{ github.event.pull_request.number }}" \ "${{ github.head_ref }}" \ - "starting" \ - "${{ steps.start-time.outputs.time }}" + "starting" # Deploy and comment for non-forked PRs only deploy-and-comment: diff --git a/.github/workflows/ci-tests-storybook-forks.yaml b/.github/workflows/ci-tests-storybook-forks.yaml index d4f18d37b..0d4ab96f1 100644 --- a/.github/workflows/ci-tests-storybook-forks.yaml +++ b/.github/workflows/ci-tests-storybook-forks.yaml @@ -6,9 +6,6 @@ on: workflows: ['CI: Tests Storybook'] types: [requested, completed] -env: - DATE_FORMAT: '+%m/%d/%Y, %I:%M:%S %p' - jobs: deploy-and-comment-forked-pr: runs-on: ubuntu-latest @@ -63,8 +60,7 @@ jobs: ./scripts/cicd/pr-storybook-deploy-and-comment.sh \ "${{ steps.pr.outputs.result }}" \ "${{ github.event.workflow_run.head_branch }}" \ - "starting" \ - "$(date -u '${{ env.DATE_FORMAT }}')" + "starting" - name: Download and Deploy Storybook if: steps.pr.outputs.result != 'null' && github.event.action == 'completed' && github.event.workflow_run.conclusion == 'success' diff --git a/.github/workflows/ci-tests-storybook.yaml b/.github/workflows/ci-tests-storybook.yaml index 7a91e7a01..4c2fb4478 100644 --- a/.github/workflows/ci-tests-storybook.yaml +++ b/.github/workflows/ci-tests-storybook.yaml @@ -24,8 +24,7 @@ jobs: ./scripts/cicd/pr-storybook-deploy-and-comment.sh \ "${{ github.event.pull_request.number }}" \ "${{ github.head_ref }}" \ - "starting" \ - "$(date -u '+%m/%d/%Y, %I:%M:%S %p')" + "starting" # Build Storybook for all PRs (free Cloudflare deployment) storybook-build: diff --git a/scripts/cicd/pr-playwright-deploy-and-comment.sh b/scripts/cicd/pr-playwright-deploy-and-comment.sh index ed8951034..f32a67e62 100755 --- a/scripts/cicd/pr-playwright-deploy-and-comment.sh +++ b/scripts/cicd/pr-playwright-deploy-and-comment.sh @@ -2,7 +2,7 @@ set -e # Deploy Playwright test reports to Cloudflare Pages and comment on PR -# Usage: ./pr-playwright-deploy-and-comment.sh [start_time] +# Usage: ./pr-playwright-deploy-and-comment.sh # Input validation # Validate PR number is numeric @@ -31,8 +31,6 @@ case "$STATUS" in ;; esac -START_TIME="${4:-$(date -u '+%m/%d/%Y, %I:%M:%S %p')}" - # Required environment variables : "${GITHUB_TOKEN:?GITHUB_TOKEN is required}" : "${GITHUB_REPOSITORY:?GITHUB_REPOSITORY is required}" @@ -135,23 +133,8 @@ post_comment() { # Main execution if [ "$STATUS" = "starting" ]; then # Post concise starting comment - comment=$(cat < -📊 Browser Tests - -- **chromium**: Running... -- **chromium-0.5x**: Running... -- **chromium-2x**: Running... -- **mobile-chrome**: Running... - - -EOF -) + comment="$COMMENT_MARKER +## 🎭 Playwright: âŗ Running..." post_comment "$comment" else @@ -300,7 +283,7 @@ else # Generate compact single-line comment comment="$COMMENT_MARKER -**Playwright:** $status_icon $total_passed passed, $total_failed failed$flaky_note" +## 🎭 Playwright: $status_icon $total_passed passed, $total_failed failed$flaky_note" # Extract and display failed tests from all browsers (flaky tests are treated as passing) if [ $total_failed -gt 0 ]; then diff --git a/scripts/cicd/pr-storybook-deploy-and-comment.sh b/scripts/cicd/pr-storybook-deploy-and-comment.sh index a2a1d37e9..2b2051737 100755 --- a/scripts/cicd/pr-storybook-deploy-and-comment.sh +++ b/scripts/cicd/pr-storybook-deploy-and-comment.sh @@ -2,7 +2,7 @@ set -e # Deploy Storybook to Cloudflare Pages and comment on PR -# Usage: ./pr-storybook-deploy-and-comment.sh [start_time] +# Usage: ./pr-storybook-deploy-and-comment.sh # Input validation # Validate PR number is numeric @@ -31,7 +31,6 @@ case "$STATUS" in ;; esac -START_TIME="${4:-$(date -u '+%m/%d/%Y, %I:%M:%S %p')}" # Required environment variables : "${GITHUB_TOKEN:?GITHUB_TOKEN is required}" @@ -120,50 +119,9 @@ post_comment() { # Main execution if [ "$STATUS" = "starting" ]; then - # Check if this is a version-bump branch - IS_VERSION_BUMP="false" - if echo "$BRANCH_NAME" | grep -q "^version-bump-"; then - IS_VERSION_BUMP="true" - fi - - # Post starting comment with appropriate message - if [ "$IS_VERSION_BUMP" = "true" ]; then - comment=$(cat < **Build is starting...** - -⏰ Started at: $START_TIME UTC - -### 🚀 Building Storybook -- đŸ“Ļ Installing dependencies... -- 🔧 Building Storybook components... -- 🎨 Running Chromatic visual tests... - ---- -âąī¸ Please wait while the Storybook build is in progress... -EOF -) - else - comment=$(cat < **Build is starting...** - -⏰ Started at: $START_TIME UTC - -### 🚀 Building Storybook -- đŸ“Ļ Installing dependencies... -- 🔧 Building Storybook components... -- 🌐 Preparing deployment to Cloudflare Pages... - ---- -âąī¸ Please wait while the Storybook build is in progress... -EOF -) - fi + # Post starting comment + comment="$COMMENT_MARKER +## 🎨 Storybook: loading Building..." post_comment "$comment" elif [ "$STATUS" = "completed" ]; then @@ -192,56 +150,57 @@ elif [ "$STATUS" = "completed" ]; then WORKFLOW_CONCLUSION="${WORKFLOW_CONCLUSION:-success}" WORKFLOW_URL="${WORKFLOW_URL:-}" - # Generate completion comment based on conclusion + # Generate compact header based on conclusion if [ "$WORKFLOW_CONCLUSION" = "success" ]; then status_icon="✅" - status_text="Build completed successfully!" - footer_text="🎉 Your Storybook is ready for review!" + status_text="Built" elif [ "$WORKFLOW_CONCLUSION" = "skipped" ]; then status_icon="â­ī¸" - status_text="Build skipped." - footer_text="â„šī¸ Chromatic was skipped for this PR." + status_text="Skipped" elif [ "$WORKFLOW_CONCLUSION" = "cancelled" ]; then status_icon="đŸšĢ" - status_text="Build cancelled." - footer_text="â„šī¸ The Chromatic run was cancelled." + status_text="Cancelled" else status_icon="❌" - status_text="Build failed!" - footer_text="âš ī¸ Please check the workflow logs for error details." + status_text="Failed" fi - - comment="$COMMENT_MARKER -## 🎨 Storybook Build Status -$status_icon **$status_text** + # Build compact header with optional storybook link + header="## 🎨 Storybook: $status_icon $status_text" + if [ "$deployment_url" != "Not deployed" ] && [ "$deployment_url" != "Deployment failed" ] && [ "$WORKFLOW_CONCLUSION" = "success" ]; then + header="$header — $deployment_url" + fi + + # Build details section + details="
+Details ⏰ Completed at: $(date -u '+%m/%d/%Y, %I:%M:%S %p') UTC -### 🔗 Links +**Links** - [📊 View Workflow Run]($WORKFLOW_URL)" - - # Add deployment status + if [ "$deployment_url" != "Not deployed" ]; then if [ "$deployment_url" = "Deployment failed" ]; then - comment="$comment + details="$details - ❌ Storybook deployment failed" - elif [ "$WORKFLOW_CONCLUSION" = "success" ]; then - comment="$comment -- 🎨 $deployment_url" - else - comment="$comment -- âš ī¸ Build failed - $deployment_url" + elif [ "$WORKFLOW_CONCLUSION" != "success" ]; then + details="$details +- âš ī¸ Build failed — $deployment_url" fi elif [ "$WORKFLOW_CONCLUSION" != "success" ]; then - comment="$comment + details="$details - â­ī¸ Storybook deployment skipped (build did not succeed)" fi - - comment="$comment ---- -$footer_text" + details="$details + +
" + + comment="$COMMENT_MARKER +$header + +$details" post_comment "$comment" fi \ No newline at end of file