Skip to content

swagger updates #2655

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
21 changes: 11 additions & 10 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,25 @@
echo "ACCOUNT_NUMBER=${{ secrets.DEV_ACCOUNT_NUMBER }}" >> $GITHUB_ENV
fi

- uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install pipenv
run: pip install pipenv

- name: Checkout Code Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install uv
uses: astral-sh/setup-uv@v5

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'build_and_deploy.yml' step
Uses Step
uses 'astral-sh/setup-uv' with ref 'v5', not a pinned commit hash
with:
enable-cache: true

- name: Install the project
run: uv sync --locked --all-extras --dev

- name: Authenticate GitHub CLI
run: gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"

- name: Build Site
run: |
python build_branches.py -env "${{ inputs.environment }}"
uv run python build_branches.py -env "${{ inputs.environment }}"

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
Expand All @@ -77,7 +78,7 @@

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
uses: aws-actions/amazon-ecr-login@v2

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'build_and_deploy.yml' step
Uses Step: login-ecr
uses 'aws-actions/amazon-ecr-login' with ref 'v2', not a pinned commit hash

- name: Build, tag, and push image to Amazon ECR
id: build-image
Expand Down
78 changes: 32 additions & 46 deletions .github/workflows/build_and_deploy_gcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,46 +35,25 @@
contents: write
pull-requests: write
steps:
- uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install pipenv
run: pip install pipenv

- name: Checkout Code Repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install uv
uses: astral-sh/setup-uv@v5

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'build_and_deploy_gcp.yml' step
Uses Step
uses 'astral-sh/setup-uv' with ref 'v5', not a pinned commit hash
with:
enable-cache: true

- name: Install the project
run: uv sync --locked --all-extras --dev

- name: Authenticate GitHub CLI
run: gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"

- name: Build Site
run: |
python build_branches.py -env "${{ inputs.environment }}"

- name: Construct metadata tags input
id: metadata-tags
run: |
echo 'tag_config<<EOF' >> $GITHUB_OUTPUT

if [ -n "${{ needs.generate-version.outputs.version }}" ]; then
echo "type=raw,value=${{ needs.generate-version.outputs.version }}" >> $GITHUB_OUTPUT
else
echo "type=ref,event=branch" >> $GITHUB_OUTPUT
echo "type=ref,event=pr" >> $GITHUB_OUTPUT
echo "type=semver,pattern={{version}}" >> $GITHUB_OUTPUT
echo "type=semver,pattern={{major}}.{{minor}}" >> $GITHUB_OUTPUT
fi

echo 'EOF' >> $GITHUB_OUTPUT

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uv run python build_branches.py -env "${{ inputs.environment }}"

- name: Authenticate with GCP via OIDC
uses: google-github-actions/auth@v2
Expand All @@ -87,20 +66,27 @@
run: |
echo '{"credHelpers": {"europe-west2-docker.pkg.dev": "gcloud"}}' > ~/.docker/config.json

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: ${{ needs.generate-version.outputs.version }}
flavor: |
latest=false
- name: Sanitize and Set IMAGE_TAG
id: set-image-tag
run: |
# Get the version from the previous job output
RAW_VERSION="${{ needs.generate-version.outputs.version }}"

- name: Push to GCP Artifact Registry
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
# Sanitize the version:
# 1. Replace invalid characters (like +, :, /) with hyphens
# 2. Remove any leading/trailing hyphens or multiple consecutive hyphens
# This creates a more Docker-friendly tag
SANITIZED_VERSION=$(echo "$RAW_VERSION" | sed -E 's/[^a-zA-Z0-9._-]+/-/g' | sed -E 's/^-+|-+$//g' | sed -E 's/--+/-/g')

# Combine with run_number for uniqueness, ensuring it's valid
FINAL_IMAGE_TAG="${SANITIZED_VERSION}-${{ github.run_number }}"

echo "Generated Docker Tag: $FINAL_IMAGE_TAG"
echo "IMAGE_TAG=$FINAL_IMAGE_TAG" >> $GITHUB_ENV

- name: Build and Push image to GCP Artifact Registry
id: build-image
run: |
docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} -f Dockerfile.review .
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
echo "image_uri=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}" >> $GITHUB_OUTPUT
2 changes: 1 addition & 1 deletion .github/workflows/deploy_gcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ jobs:
environment: ${{(github.ref == 'refs/heads/dev' && 'dev') ||
(github.ref == 'refs/heads/main' && 'staging') ||
(github.event_name == 'pull_request' && 'dev')}}
core_app: ${{ github.ref == 'refs/heads/main' && 'polygon-docs-main' || 'polygon-docs-dev' }}
core_app: ${{ github.ref == 'refs/heads/main' && 'polygon-docs' || 'polygon-docs-dev' }}
secrets: inherit
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
.vscode
.code
.idea
.repo-cache/
site/
venv/
env/
branch/
app/
temp_dir/
*.out
node_modules/
.DS_Store
**/.DS_Store
*.iml
temp_dir/
package-lock.json
package.json
branch/

1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
Loading