Skip to content
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

Bump int128/datadog-actions-metrics from 1.64.0 to 1.77.0 #1486

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .github/ISSUE_TEMPLATE/pw-clp-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@ Help desk ticket: <insert_help_desk_link>
- [ ] Name of submitter (if applicable)
Submitter: <insert_name>

- Campaign title:
- Who the editor(s) will be for the Campaign Landing Page and any appropriate stakeholders for awareness:
- The goals/outcomes you are looking to achieve with the campaign:
- Outcome success measurement & how it will be measured (note: "Page views" is not a generally accepted success measurement):
- Target Audience(s):
- Campaign start/end dates:
- Is this a seasonal campaign?
- If not: when campaign ends, should campaign page be archived or redirected?
- If redirected, where should it redirect?

## Acceptance criteria

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/actions-metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
timeout-minutes: 10
steps:
- name: Send GitHub Actions metrics to DataDog
uses: int128/datadog-actions-metrics@12d225bf2f764e5103a994157c1316df39dc3fae # v1.68.0
uses: int128/datadog-actions-metrics@56be1c4bf92adece9d10f7fef4ba48bccf8e8c81 # v1.77.0
with:
datadog-api-key: ${{ secrets.DATADOG_API_KEY }}
collect-job-metrics: true
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/gha-diagnostics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Diagnose github context
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
paths-ignore:
- '**.md'

jobs:
gha_diagnostics:
runs-on: ubuntu-latest
name: Diagnose github context
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
107 changes: 107 additions & 0 deletions .github/workflows/tugboat-dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Dispatch Tugboat API Calls
on:
workflow_dispatch:
inputs:
action:
type: choice
description: 'Tugboat API action'
options:
- create
- rebuild
- delete
required: true
pr_number:
type: number
description: 'The pull request number to take action on'
required: true
pr_title:
type: string
description: 'The pull request title for creating previews, requied for creation'
required: false
jobs:
dispatch_tugboat_api:
runs-on: self-hosted
env:
NODE_EXTRA_CA_CERTS: /etc/ssl/certs/ca-certificates.crt
name: Dispatch Tugboat API Calls
steps:
# Setup
- name: Confirm Workflow Inputs
run: |
echo "Action: ${{ inputs.action }} PR Number: ${{ inputs.pr_number }} PR Title: ${{ inputs.pr_title }}"

# Restore Preview ID for non-creation actions
- name: Restore Preview ID
if: ${{ inputs.action != 'create' }}
uses: actions/cache/restore@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
with:
path: .tugboat_preview.txt
key: ${{ runner.os }}-tugboat-preview-id-pr-${{ inputs.pr_number }}
- name: Set Preview ID
if: ${{ inputs.action != 'create' }}
run: |
if ! [ -f .tugboat_preview.txt ]; then
echo "Preview ID not found, please contact platform-cms-qa on Github or CMS QA Engineers in #cms-support on Slack for assistance."
exit 1
fi
PREVIEW_ID=$(cat .tugboat_preview.txt)
echo "Preview ID: ${PREVIEW_ID}"
echo "PREVIEW_ID=$PREVIEW_ID" >> $GITHUB_ENV

# Make API calls
- name: Create Tugboat Preview
id: tugboat_pr_preview
if: ${{ inputs.action == 'create' }}
run: |
curl --fail \
-H "Authorization: Bearer ${{ secrets.TUGBOAT_API_TOKEN }}" \
-H "Content-Type: application/json" \
-X POST \
-d '{ "repo": "${{ secrets.TUGBOAT_REPOSITORY }}", "ref": "${{ inputs.pr_number }}", "name": "${{ inputs.pr_title }}", "type": "pullrequest" }' \
-o .tugboat_response.json \
https://api.tugboat.vfs.va.gov/v3/previews
- name: Rebuild Tugboat Preview
if: ${{ inputs.action == 'rebuild' }}
run: |
curl --fail \
-H "Authorization: Bearer ${{ secrets.TUGBOAT_API_TOKEN }}" \
-H "Content-Type: application/json" \
-X POST \
-d '{ "children": "false", "force": "false" }' \
https://api.tugboat.vfs.va.gov/v3/previews/${{ env.PREVIEW_ID }}/rebuild
- name: Delete Tugboat Preview
if: ${{ inputs.action == 'delete' }}
run: |
curl --fail \
-H "Authorization: Bearer ${{ secrets.TUGBOAT_API_TOKEN }}" \
-H "Content-Type: application/json" \
-X DELETE \
-d '{ "force": "false" }' \
https://api.tugboat.vfs.va.gov/v3/previews/${{ env.PREVIEW_ID }}

# Store Preview ID in cache on creation
- name: Extract Preview ID
if: ${{ inputs.action == 'create' }}
run: jq -r .preview .tugboat_response.json > .tugboat_preview.txt
- name: Confirm Preview ID
if: ${{ inputs.action == 'create' }}
run: cat .tugboat_preview.txt
- name: Delete Previous Preview ID
continue-on-error: true
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
with:
script: |
await github.rest.actions.deleteActionsCacheByKey({
owner: context.repo.owner,
repo: context.repo.repo,
key: `${{ runner.os }}-tugboat-preview-id-pr-${{ inputs.pr_number }}`,
});
- name: Save Preview ID
uses: actions/cache/save@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
with:
path: .tugboat_preview.txt
key: ${{ runner.os }}-tugboat-preview-id-pr-${{ inputs.pr_number }}

# Cleanup
- name: Cleanup temporary file
run: rm .tugboat_preview.txt
41 changes: 15 additions & 26 deletions .github/workflows/tugboat-pr-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,21 @@ on:

jobs:
tugboat_delete_preview:
runs-on: self-hosted
env:
NODE_EXTRA_CA_CERTS: /etc/ssl/certs/ca-certificates.crt
runs-on: ubuntu-latest
name: Delete Tugboat Preview
steps:
- name: Restore Preview ID
uses: actions/cache/restore@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3.3.3
- name: Dispatch Tugboat Preview Deletion
continue-on-error: true
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
with:
path: .tugboat_preview.txt
key: ${{ runner.os }}-tugboat-preview-id-pr-${{ github.event.pull_request.number }}
- name: Set Preview ID
run: |
if ! [ -f .tugboat_preview.txt ]; then
echo "Preview ID not found, please manually delete Tugboat Preview. Contact platform-cms-qa on Github or CMS QA Engineers in #cms-support on Slack for assistance."
exit 1
fi
PREVIEW_ID=$(cat .tugboat_preview.txt)
echo "Preview ID: ${PREVIEW_ID}"
echo "PREVIEW_ID=$PREVIEW_ID" >> $GITHUB_ENV
- name: Cleanup temporary file
run: rm .tugboat_preview.txt
- name: Delete Tugboat Preview
run: |
curl --fail \
-H "Authorization: Bearer ${{ secrets.TUGBOAT_API_TOKEN }}" \
-H "Content-Type: application/json" \
-X DELETE \
-d '{ "force": "false" }' \
https://api.tugboat.vfs.va.gov/v3/previews/${{ env.PREVIEW_ID }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'tugboat-dispatch.yml',
ref: 'main',
inputs: {
action: 'delete',
pr_number: '${{ github.event.pull_request.number }}',
}
});
37 changes: 10 additions & 27 deletions .github/workflows/tugboat-pr-opened.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,22 @@ on:

jobs:
tugboat_create_preview:
runs-on: self-hosted
env:
NODE_EXTRA_CA_CERTS: /etc/ssl/certs/ca-certificates.crt
runs-on: ubuntu-latest
name: Create Tugboat Preview
steps:
- name: Create Tugboat Preview
id: tugboat_pr_preview
run: |
curl --fail \
-H "Authorization: Bearer ${{ secrets.TUGBOAT_API_TOKEN }}" \
-H "Content-Type: application/json" \
-X POST \
-d '{ "repo": "${{ secrets.TUGBOAT_REPOSITORY }}", "ref": "${{ github.event.pull_request.number }}", "name": "${{ github.event.pull_request.title }}", "type": "pullrequest" }' \
-o .tugboat_response.json \
https://api.tugboat.vfs.va.gov/v3/previews
- name: Diagnostics
run: cat .tugboat_response.json
- name: Extract Preview ID
run: jq -r .preview .tugboat_response.json > .tugboat_preview.txt
- name: Delete Previous Preview ID
- name: Dispatch Tugboat Preview Creation
continue-on-error: true
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
with:
script: |
await github.rest.actions.deleteActionsCacheByKey({
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
key: `${{ runner.os }}-tugboat-preview-id-pr-${{ github.event.pull_request.number }}`,
workflow_id: 'tugboat-dispatch.yml',
ref: 'main',
inputs: {
action: 'create',
pr_number: '${{ github.event.pull_request.number }}',
pr_title: '${{ github.event.pull_request.title }}',
}
});
- name: Save Preview ID
uses: actions/cache/save@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3.3.3
with:
path: .tugboat_preview.txt
key: ${{ runner.os }}-tugboat-preview-id-pr-${{ github.event.pull_request.number }}
- name: Cleanup temporary file
run: rm .tugboat_preview.txt
41 changes: 15 additions & 26 deletions .github/workflows/tugboat-pr-updated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,21 @@ on:

jobs:
tugboat_rebuild_preview:
runs-on: self-hosted
env:
NODE_EXTRA_CA_CERTS: /etc/ssl/certs/ca-certificates.crt
runs-on: ubuntu-latest
name: Rebuild Tugboat Preview
steps:
- name: Restore Preview ID
uses: actions/cache/restore@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3.3.3
- name: Dispatch Tugboat Preview Rebuild
continue-on-error: true
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
with:
path: .tugboat_preview.txt
key: ${{ runner.os }}-tugboat-preview-id-pr-${{ github.event.pull_request.number }}
- name: Set Preview ID
run: |
if ! [ -f .tugboat_preview.txt ]; then
echo "Preview ID not found, please manually rebuild Tugboat Preview. Contact platform-cms-qa on Github or CMS QA Engineers in #cms-support on Slack for assistance."
exit 1
fi
PREVIEW_ID=$(cat .tugboat_preview.txt)
echo "Preview ID: ${PREVIEW_ID}"
echo "PREVIEW_ID=$PREVIEW_ID" >> $GITHUB_ENV
- name: Cleanup temporary file
run: rm .tugboat_preview.txt
- name: Rebuild Tugboat Preview
run: |
curl --fail \
-H "Authorization: Bearer ${{ secrets.TUGBOAT_API_TOKEN }}" \
-H "Content-Type: application/json" \
-X POST \
-d '{ "children": "false", "force": "false" }' \
https://api.tugboat.vfs.va.gov/v3/previews/${{ env.PREVIEW_ID }}/rebuild
script: |
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'tugboat-dispatch.yml',
ref: 'main',
inputs: {
action: 'rebuild',
pr_number: '${{ github.event.pull_request.number }}',
}
});
29 changes: 0 additions & 29 deletions .github/workflows/tugboat-refresh-cache-responder.yml

This file was deleted.

Loading
Loading