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

ci: add project fields validator #334

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
9a1d081
ci: add project-fields-validator
minikin Oct 18, 2024
1f8dbcb
chore: update python and earthly
minikin Oct 21, 2024
1edb413
Update Earthfile
minikin Oct 22, 2024
1d738f3
feat: update ProjectFieldsValidator
minikin Oct 22, 2024
f0e8d76
chore: refactor python code
minikin Oct 22, 2024
debf21b
Update README.md
minikin Oct 22, 2024
dd17f55
Update main.py
minikin Oct 22, 2024
045e5db
chore: ci lint fixes
minikin Oct 22, 2024
a818e6f
Update Earthfile
minikin Oct 22, 2024
a09ca82
Update Earthfile
minikin Oct 23, 2024
46a289d
Update Earthfile
minikin Oct 24, 2024
7e18b29
Update Earthfile
minikin Oct 24, 2024
061098f
Update Earthfile
minikin Oct 24, 2024
f1aadfb
Update Earthfile
minikin Oct 25, 2024
cae42c4
feat: add GitHub action
minikin Oct 25, 2024
a8c6448
Merge branch 'master' into feat/validate-project-fields-in-prs-and-is…
minikin Oct 25, 2024
304b6f2
Update validate-project-fields.yml
minikin Oct 25, 2024
6586bc7
Update validate-project-fields.yml
minikin Oct 25, 2024
c8bc9ed
wip: clean up
minikin Oct 25, 2024
8042e83
chore: add GITHUB_TOKEN
minikin Oct 25, 2024
a5a5f29
Update Earthfile
minikin Oct 25, 2024
33a8b4e
Update validate-project-fields.yml
minikin Oct 25, 2024
6e11382
Update validate-project-fields.yml
minikin Oct 25, 2024
2cc8180
Update validate-project-fields.yml
minikin Oct 25, 2024
fb45eb6
wip
minikin Oct 25, 2024
55ad662
wip
minikin Oct 25, 2024
e4577bd
wip
minikin Oct 25, 2024
dcf7afa
Update validate-project-fields.yml
minikin Oct 25, 2024
7b13c3f
wip
minikin Oct 25, 2024
279e0ae
wip: testing
jmgilman Oct 25, 2024
bcd275e
wip: testing
jmgilman Oct 25, 2024
e427593
wip: testing
jmgilman Oct 25, 2024
d27bbcb
wip: testing
jmgilman Oct 25, 2024
8202e22
chore: merge branch 'master' into feat/validate-project-fields-in-prs…
jmgilman Oct 25, 2024
039d0b9
wip: cleanup
jmgilman Oct 25, 2024
976f449
Update main.py
minikin Oct 27, 2024
a7cd613
Update main.py
minikin Oct 27, 2024
6736c79
Update main.py
minikin Oct 27, 2024
0efd054
Update validate-project-fields.yml
minikin Oct 27, 2024
4a40ecf
Merge branch 'master' into feat/validate-project-fields-in-prs-and-is…
minikin Oct 28, 2024
2c28d0c
Merge branch 'master' into feat/validate-project-fields-in-prs-and-is…
minikin Oct 29, 2024
919ce82
Merge branch 'master' into feat/validate-project-fields-in-prs-and-is…
minikin Nov 4, 2024
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
51 changes: 51 additions & 0 deletions .github/workflows/validate-project-fields.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Validate Project Fields

on:
pull_request:
types:
- opened
- edited
- synchronize
- reopened
- unassigned

permissions:
contents: write
pull-requests: write
id-token: write
repository-projects: write

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

env:
AWS_REGION: eu-central-1
AWS_ROLE_ARN: arn:aws:iam::332405224602:role/ci
EARTHLY_TARGET: docker
ECR_REGISTRY: 332405224602.dkr.ecr.eu-central-1.amazonaws.com

jobs:
validate-project-fields:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup CI
uses: input-output-hk/catalyst-ci/actions/setup@master
with:
aws_role_arn: ${{ env.AWS_ROLE_ARN }}
aws_region: ${{ env.AWS_REGION }}
earthly_runner_secret: ${{ secrets.EARTHLY_RUNNER_SECRET }}

- name: Run Project Fields Validation
uses: input-output-hk/catalyst-ci/actions/run@master
if: always()
continue-on-error: false
with:
earthfile: ./utilities/project-fields-validator
flags: --allow-privileged
targets: validate-project-fields
target_flags: --GITHUB_REPOSITORY="${{ github.repository }}" --GITHUB_EVENT_NUMBER="${{ github.event.number || '0' }}"
runner_address: ${{ secrets.EARTHLY_SATELLITE_ADDRESS }}
artifact: false
24 changes: 24 additions & 0 deletions utilities/project-fields-validator/Earthfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/python:v3.1.7 AS python-ci

test:
FROM python-ci+python-base
COPY . .
DO python-ci+CHECK

validate-project-fields:
FROM python-ci+python-base
COPY . .

RUN pip install requests

ARG PROJECT_NUMBER=102
ARG --required GITHUB_REPOSITORY
ARG --required GITHUB_EVENT_NUMBER

ENV PROJECT_NUMBER=${PROJECT_NUMBER}
ENV GITHUB_REPOSITORY=${GITHUB_REPOSITORY}
ENV GITHUB_EVENT_NUMBER=${GITHUB_EVENT_NUMBER}

RUN --no-cache --secret GITHUB_TOKEN python3 main.py

Check failure on line 24 in utilities/project-fields-validator/Earthfile

View workflow job for this annotation

GitHub Actions / validate-project-fields

Error

The command RUN --no-cache python3 main.py did not complete successfully. Exit code 1
6 changes: 6 additions & 0 deletions utilities/project-fields-validator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Project fields validator

This module is used to validate the fields of a project.

* auto assign PR creator as assignee
* verifies that all project fields are filled out and fail if any are left unfilled.
Loading