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

Danaelhe patch 19 #823

Closed
wants to merge 53 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
a88445f
Update trigger-python-client-gen.yml
danaelhe Sep 19, 2023
0cd9497
Update and rename spec.pr.yml to .spec.pr.yml
danaelhe Sep 19, 2023
5645aa0
Update DigitalOcean-public.v2.yaml
danaelhe Sep 19, 2023
4a7046c
Merge pull request #1 from danaelhe/danaelhe-patch-2
danaelhe Sep 19, 2023
0891b14
Update spec.main.yml
danaelhe Sep 19, 2023
988efe5
Update DigitalOcean-public.v2.yaml
danaelhe Sep 19, 2023
583ae13
Merge pull request #2 from danaelhe/danaelhe-patch-3
danaelhe Sep 19, 2023
fb4d587
Update trigger-python-client-gen.yml
danaelhe Sep 19, 2023
27ef357
Update trigger-python-client-gen.yml
danaelhe Sep 19, 2023
ca31ffa
Update DigitalOcean-public.v2.yaml
danaelhe Sep 19, 2023
8ab1aa1
Merge pull request #3 from danaelhe/danaelhe-patch-5
danaelhe Sep 19, 2023
85644fb
Update trigger-python-client-gen.yml
danaelhe Sep 19, 2023
821fe40
Update DigitalOcean-public.v2.yaml
danaelhe Sep 19, 2023
b4c07ae
Merge pull request #4 from danaelhe/danaelhe-patch-6
danaelhe Sep 19, 2023
10c6af8
Update DigitalOcean-public.v2.yaml
danaelhe Sep 19, 2023
3f53dc7
Merge pull request #5 from danaelhe/danaelhe-patch-7
danaelhe Sep 19, 2023
2e6648f
Update spec.main.yml
danaelhe Sep 19, 2023
d463efc
Update DigitalOcean-public.v2.yaml
danaelhe Sep 19, 2023
a354a19
Merge pull request #6 from danaelhe/danaelhe-patch-8
danaelhe Sep 19, 2023
01d2645
Update DigitalOcean-public.v2.yaml
danaelhe Sep 19, 2023
cad8e93
Merge pull request #7 from danaelhe/danaelhe-patch-9
danaelhe Sep 19, 2023
3211201
Update spec.pr-comment-trigger.yml
danaelhe Sep 19, 2023
61957e2
Update DigitalOcean-public.v2.yaml
danaelhe Sep 19, 2023
338b3a2
Merge pull request #8 from danaelhe/danaelhe-patch-10
danaelhe Sep 19, 2023
e152163
Update .spec.pr.yml
danaelhe Sep 19, 2023
6b8b3e5
Update DigitalOcean-public.v2.yaml
danaelhe Sep 19, 2023
6bceade
Merge pull request #9 from danaelhe/danaelhe-patch-11
danaelhe Sep 19, 2023
638c947
Update validate-client-generation.yml
danaelhe Sep 19, 2023
2a09252
Update DigitalOcean-public.v2.yaml
danaelhe Sep 19, 2023
fb09387
Merge pull request #10 from danaelhe/danaelhe-patch-12
danaelhe Sep 19, 2023
87a9ee9
Update spec.pr-comment-trigger.yml
danaelhe Sep 19, 2023
1e08f3c
Update .spec.pr.yml
danaelhe Sep 19, 2023
730d3ea
Update DigitalOcean-public.v2.yaml
danaelhe Sep 19, 2023
9f60162
Update DigitalOcean-public.v2.yaml
danaelhe Sep 19, 2023
d27eec3
Merge pull request #11 from danaelhe/danaelhe-patch-13
danaelhe Sep 19, 2023
65da77b
Update spec.main.yml
danaelhe Sep 19, 2023
f254a1f
Update DigitalOcean-public.v2.yaml
danaelhe Sep 19, 2023
5597b92
Merge pull request #12 from danaelhe/danaelhe-patch-14
danaelhe Sep 19, 2023
d9c1715
Update trigger-python-client-gen.yml
danaelhe Sep 19, 2023
ca4b9fd
Update spec.main.yml
danaelhe Sep 19, 2023
fb2b8b2
Update DigitalOcean-public.v2.yaml
danaelhe Sep 19, 2023
6147240
Merge pull request #13 from danaelhe/danaelhe-patch-15
danaelhe Sep 19, 2023
add9e13
Update spec.main.yml
danaelhe Sep 19, 2023
2f45331
Update DigitalOcean-public.v2.yaml
danaelhe Sep 19, 2023
1fd4d99
Merge pull request #14 from danaelhe/danaelhe-patch-16
danaelhe Sep 19, 2023
2fe6fcf
Update spec.main.yml
danaelhe Sep 19, 2023
3b57782
Update DigitalOcean-public.v2.yaml
danaelhe Sep 19, 2023
a5e755b
Merge pull request #15 from danaelhe/danaelhe-patch-17
danaelhe Sep 19, 2023
965932b
Update spec.main.yml
danaelhe Sep 19, 2023
0c07ec3
Update DigitalOcean-public.v2.yaml
danaelhe Sep 19, 2023
98b1661
Merge pull request #16 from danaelhe/danaelhe-patch-18
danaelhe Sep 19, 2023
a5f8bd8
Update spec.main.yml
danaelhe Sep 19, 2023
e366050
Update DigitalOcean-public.v2.yaml
danaelhe Sep 19, 2023
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
84 changes: 84 additions & 0 deletions .github/workflows/.spec.pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Spec PR
# This workflow uploads a copy of the spec with the respective changes in the PR
# to the team Space.
#
# The name of the uploaded file will be prefixed with the PR number.
# e.g. `spec-ci/previews/123-spec.yaml

on: [pull_request]

jobs:
lint:
name: Validate spec
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run linter
run: make lint

bundle-spec:
name: Bundle Spec
runs-on: ubuntu-latest

needs: lint

steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v1
with:
node-version: '14.x'

- name: Bundle
run: make bundle

- uses: actions/upload-artifact@v2
with:
name: openapi-bundled
path: tests/openapi-bundled.yaml

generate-preview:
# As this job needs access to secrets, skip it if the PR comes from a fork.
if: github.event.pull_request.head.repo.full_name == github.repository
name: Generate Preview
runs-on: ubuntu-latest

needs: bundle-spec

steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v1
with:
node-version: '14.x'

# - name: Bundle
# run: make bundle

# - uses: actions/upload-artifact@v2
# with:
# name: openapi-bundled
# path: tests/openapi-bundled.yaml

# - name: Upload PR spec
# run: >-
# aws s3 cp tests/openapi-bundled.yaml
# ${{ env.SPACES_PATH }}/previews/${{ github.event.number }}-spec.yaml
# --endpoint=${{ env.SPACES_ENDPOINT }}
# --acl public-read
# env:
# AWS_ACCESS_KEY_ID: ${{ secrets.SPACES_ACCESS_KEY }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.SPACES_ACCESS_SECRET }}
# AWS_DEFAULT_OUTPUT: json
# SPACES_PATH: ${{ secrets.SPACES_PATH }}
# SPACES_ENDPOINT: ${{ secrets.SPACES_ENDPOINT }}
# AWS_EC2_METADATA_DISABLED: true

# - uses: Sibz/github-status-action@v1
# with:
# authToken: ${{secrets.GITHUB_TOKEN}}
# context: Spec Preview URL
# description: Ready
# state: success
# sha: ${{ github.event.pull_request.head.sha }}
# target_url: https://api-engineering.nyc3.digitaloceanspaces.com/spec-ci/redoc-index.html?pr=${{ github.event.number }}
73 changes: 40 additions & 33 deletions .github/workflows/spec.main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,43 +30,50 @@ jobs:
with:
node-version: '14.x'

- name: Bundle
run: make bundle
# - name: Bundle
# run: make bundle

- uses: actions/upload-artifact@v2
with:
name: openapi-bundled
path: tests/openapi-bundled.yaml
# - uses: actions/upload-artifact@v2
# with:
# name: openapi-bundled
# path: tests/openapi-bundled.yaml
- name: Set outputs
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Check outputs
run: echo ${{ steps.vars.outputs.sha_short }}
- name: Upload Main spec
run: >-
aws s3 cp tests/openapi-bundled.yaml
${{ env.SPACES_PATH }}/DigitalOcean-public.v2.yaml
--endpoint=${{ env.SPACES_ENDPOINT }}
--acl public-read
env:
AWS_ACCESS_KEY_ID: ${{ secrets.SPACES_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SPACES_ACCESS_SECRET }}
AWS_DEFAULT_OUTPUT: json
SPACES_PATH: ${{ secrets.SPACES_PATH }}
SPACES_ENDPOINT: ${{ secrets.SPACES_ENDPOINT }}
AWS_EC2_METADATA_DISABLED: true
- name: Upload revision spec
# this uploads a duplicate of the bundled spec with the short sha
# appended to the file name for reference during client generation.
run: >-
aws s3 cp tests/openapi-bundled.yaml
${{ secrets.SPACES_PATH }}/DigitalOcean-public-${{ steps.vars.outputs.sha_short }}.v2.yaml
--endpoint=${{ secrets.SPACES_ENDPOINT }}
--acl public-read
- name: Print Title of PR
id: title_var
run: echo "PR_TITLE=$(gh pr list --search "${{ steps.vars.outputs.sha_short }}" --json title --jq '.[0].title')" >> "$GITHUB_OUTPUT"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.SPACES_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SPACES_ACCESS_SECRET }}
AWS_DEFAULT_OUTPUT: json
SPACES_PATH: ${{ secrets.SPACES_PATH }}
SPACES_ENDPOINT: ${{ secrets.SPACES_ENDPOINT }}
AWS_EC2_METADATA_DISABLED: true
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TRIGGER_TOKEN }}
- name: Check PR TITLE outputs
run: echo ${{ steps.title_var.outputs.PR_TITLE }}
# - name: Upload Main spec
# run: >-
# aws s3 cp tests/openapi-bundled.yaml
# ${{ env.SPACES_PATH }}/DigitalOcean-public.v2.yaml
# --endpoint=${{ env.SPACES_ENDPOINT }}
# --acl public-read
# env:
# AWS_ACCESS_KEY_ID: ${{ secrets.SPACES_ACCESS_KEY }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.SPACES_ACCESS_SECRET }}
# AWS_DEFAULT_OUTPUT: json
# SPACES_PATH: ${{ secrets.SPACES_PATH }}
# SPACES_ENDPOINT: ${{ secrets.SPACES_ENDPOINT }}
# AWS_EC2_METADATA_DISABLED: true
# - name: Upload revision spec
# # this uploads a duplicate of the bundled spec with the short sha
# # appended to the file name for reference during client generation.
# run: >-
# aws s3 cp tests/openapi-bundled.yaml
# ${{ secrets.SPACES_PATH }}/DigitalOcean-public-${{ steps.vars.outputs.sha_short }}.v2.yaml
# --endpoint=${{ secrets.SPACES_ENDPOINT }}
# --acl public-read
# env:
# AWS_ACCESS_KEY_ID: ${{ secrets.SPACES_ACCESS_KEY }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.SPACES_ACCESS_SECRET }}
# AWS_DEFAULT_OUTPUT: json
# SPACES_PATH: ${{ secrets.SPACES_PATH }}
# SPACES_ENDPOINT: ${{ secrets.SPACES_ENDPOINT }}
# AWS_EC2_METADATA_DISABLED: true
70 changes: 35 additions & 35 deletions .github/workflows/spec.pr-comment-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,41 +66,41 @@ jobs:
repository: ${{ fromJSON(steps.get-pr-branch.outputs.result).repo.full_name }}
ref: ${{ github.event.review.commit_id }}

- name: Bundle
if: steps.is-digitalocean-member.outputs.result == 'true'
run: make bundle
# - name: Bundle
# if: steps.is-digitalocean-member.outputs.result == 'true'
# run: make bundle

- uses: actions/upload-artifact@v2
if: steps.is-digitalocean-member.outputs.result == 'true'
with:
name: openapi-bundled
path: tests/openapi-bundled.yaml
# - uses: actions/upload-artifact@v2
# if: steps.is-digitalocean-member.outputs.result == 'true'
# with:
# name: openapi-bundled
# path: tests/openapi-bundled.yaml

- name: Upload PR spec
if: steps.is-digitalocean-member.outputs.result == 'true'
run: >-
aws s3 cp tests/openapi-bundled.yaml
${{ env.SPACES_PATH }}/previews/${{ github.event.issue.number }}-spec.yaml
--endpoint=${{ env.SPACES_ENDPOINT }}
--acl public-read
env:
AWS_ACCESS_KEY_ID: ${{ secrets.SPACES_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SPACES_ACCESS_SECRET }}
AWS_DEFAULT_OUTPUT: json
SPACES_PATH: ${{ secrets.SPACES_PATH }}
SPACES_ENDPOINT: ${{ secrets.SPACES_ENDPOINT }}
AWS_EC2_METADATA_DISABLED: true
# - name: Upload PR spec
# if: steps.is-digitalocean-member.outputs.result == 'true'
# run: >-
# aws s3 cp tests/openapi-bundled.yaml
# ${{ env.SPACES_PATH }}/previews/${{ github.event.issue.number }}-spec.yaml
# --endpoint=${{ env.SPACES_ENDPOINT }}
# --acl public-read
# env:
# AWS_ACCESS_KEY_ID: ${{ secrets.SPACES_ACCESS_KEY }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.SPACES_ACCESS_SECRET }}
# AWS_DEFAULT_OUTPUT: json
# SPACES_PATH: ${{ secrets.SPACES_PATH }}
# SPACES_ENDPOINT: ${{ secrets.SPACES_ENDPOINT }}
# AWS_EC2_METADATA_DISABLED: true

- name: Comment on PR
if: steps.is-digitalocean-member.outputs.result == 'true' && success()
uses: actions/github-script@v3
with:
script: |
var previewComment = '🔎 API documentation preview: https://api-engineering.nyc3.digitaloceanspaces.com/spec-ci/redoc-index.html?pr=' + '${{ github.event.pull_request.number }}';
var repository = '${{ github.repository }}'
github.issues.createComment({
issue_number: '${{ github.event.pull_request.number }}',
owner: repository.split('/')[0],
repo: repository.split('/')[1],
body: previewComment
});
# - name: Comment on PR
# if: steps.is-digitalocean-member.outputs.result == 'true' && success()
# uses: actions/github-script@v3
# with:
# script: |
# var previewComment = '🔎 API documentation preview: https://api-engineering.nyc3.digitaloceanspaces.com/spec-ci/redoc-index.html?pr=' + '${{ github.event.pull_request.number }}';
# var repository = '${{ github.repository }}'
# github.issues.createComment({
# issue_number: '${{ github.event.pull_request.number }}',
# owner: repository.split('/')[0],
# repo: repository.split('/')[1],
# body: previewComment
# });
84 changes: 0 additions & 84 deletions .github/workflows/spec.pr.yml

This file was deleted.

10 changes: 8 additions & 2 deletions .github/workflows/trigger-python-client-gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@ jobs:
- name: Set outputs
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Check outputs
- name: Print Title of PR
run: gh pr list --search "${{ steps.vars.outputs.sha_short }}" --json title --jq '.[0].title'
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TRIGGER_TOKEN }}
- name: Check short sha outputs
run: echo ${{ steps.vars.outputs.sha_short }}
- name: Check pr title outputs
run: echo $TITLE
- name: trigger-workflow
run: gh workflow run --repo digitalocean/pydo python-client-gen.yml --ref main -f openapi_short_sha=${{ steps.vars.outputs.sha_short }}
run: gh workflow run --repo danaelhe/pydo python-client-gen.yml --ref main -f openapi_short_sha=${{ steps.vars.outputs.sha_short }} pr_title=$TITLE
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TRIGGER_TOKEN }}
Loading
Loading