-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
3,587 additions
and
862 deletions.
There are no files selected for viewing
1,748 changes: 886 additions & 862 deletions
1,748
...TE/large-dataset-datacap-application.yaml → ...hub/ISSUE_TEMPLATE/issue-application.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Validate Application Approval | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
|
||
jobs: | ||
validate-approval: | ||
runs-on: ubuntu-latest | ||
env: | ||
BACKEND_URL: https://fp-core-prod.dp04sa0tdc6pk.us-east-1.cs.amazonlightsail.com | ||
steps: | ||
- name: Call Backend to Validate Application Approval | ||
id: validate | ||
run: | | ||
USER_HANDLE="${{ github.actor }}" | ||
REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f2) | ||
OWNER_NAME="${{ github.repository_owner }}" | ||
PR_NUMBER="${{ github.event.pull_request.number }}" | ||
echo "Calling backend to validate with pr_number: $PR_NUMBER, user_handle: $USER_HANDLE, repo: $REPO_NAME, and owner: $OWNER_NAME" | ||
RESPONSE=$(curl --header "Content-Type: application/json" \ | ||
--request POST \ | ||
--data '{"pr_number": "'$PR_NUMBER'", "user_handle": "'$USER_HANDLE'", "repo": "'$REPO_NAME'", "owner": "'$OWNER_NAME'"}' \ | ||
"${BACKEND_URL}/application/approval/validate") | ||
echo "Response from validation: $RESPONSE" | ||
if [ "$RESPONSE" != "true" ]; then | ||
echo "Error: Validation returned false" | ||
exit 1 | ||
fi | ||
- name: Validation Success | ||
if: steps.validate.outcome == 'success' | ||
run: echo "Validation successful!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# This workflow will automerge a pull request when some conditions are met. | ||
# Use Cases: | ||
# - When an application (new or refill) is proposed and approved by two notaries. | ||
# · application.info.application_lifecycle.state == 'Confirmed' | ||
# · application.info.application_lifecycle.first_allocation_time != '' | ||
# - When an application has reached its total datacap and the SSA bot marked it as inactive | ||
# · application.info.application_lifecycle.is_active == false | ||
name: Automerge Pull Request | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
branches: | ||
- main | ||
|
||
jobs: | ||
automerge-pr: | ||
runs-on: ubuntu-latest | ||
env: | ||
BACKEND_URL: https://fp-core-prod.dp04sa0tdc6pk.us-east-1.cs.amazonlightsail.com | ||
steps: | ||
- name: Call Backend to Validate Automerge Request | ||
id: validate | ||
run: | | ||
USER_HANDLE="${{ github.actor }}" | ||
REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f2) | ||
OWNER_NAME="${{ github.repository_owner }}" | ||
PR_NUMBER="${{ github.event.pull_request.number }}" | ||
echo "Calling backend to validate automerge with pr_number: $PR_NUMBER, user_handle: $USER_HANDLE, repo: $REPO_NAME, and owner: $OWNER_NAME" | ||
RESPONSE=$(curl --header "Content-Type: application/json" \ | ||
--request POST \ | ||
--data '{"pr_number": "'$PR_NUMBER'", "user_handle": "'$USER_HANDLE'", "repo": "'$REPO_NAME'", "owner": "'$OWNER_NAME'"}' \ | ||
"${BACKEND_URL}/application/merge/validate") | ||
echo "Response from validation: $RESPONSE" | ||
if [ "$RESPONSE" != "true" ]; then | ||
echo "Error: Validation returned false" | ||
exit 1 | ||
fi | ||
- name: Validation Success | ||
if: steps.validate.outcome == 'success' | ||
run: echo "Validation successful!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: delete branch on close pr | ||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
delete-branch: | ||
runs-on: ubuntu-latest | ||
env: | ||
BACKEND_URL: https://fp-core-prod.dp04sa0tdc6pk.us-east-1.cs.amazonlightsail.com | ||
steps: | ||
- name: Delete branch | ||
run: | | ||
REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f2) | ||
BRANCH_NAME=${{ github.head_ref }} | ||
curl -X POST "${BACKEND_URL}/application/branch/delete" \ | ||
-H "Content-Type: application/json" \ | ||
-d '{"owner": "'${{ github.repository_owner }}'", "repo": "'$REPO_NAME'", "branch_name": "'$BRANCH_NAME'"}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# This workflow will validate if an application flow is correct | ||
# Use Cases: | ||
# - When an application is in "submitted state" | ||
# · application.info.application_lifecycle.validated_by must be empty | ||
# · application.info.application_lifecycle.validated_at must be empty | ||
# · application.info.application_lifecycle.current_allocation_id must be empty | ||
# · application.info.datacap_allocations array must be empty | ||
# - When an aplication is in some other state | ||
# · actor must be the Filplus Bot | ||
name: Flow Validator | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
branches: | ||
- main | ||
|
||
jobs: | ||
validate-flow: | ||
runs-on: ubuntu-latest | ||
env: | ||
BACKEND_URL: https://fp-core-prod.dp04sa0tdc6pk.us-east-1.cs.amazonlightsail.com | ||
steps: | ||
- name: Call Backend to Validate Application Flow | ||
id: validate | ||
run: | | ||
USER_HANDLE="${{ github.actor }}" | ||
REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f2) | ||
OWNER_NAME="${{ github.repository_owner }}" | ||
PR_NUMBER="${{ github.event.pull_request.number }}" | ||
echo "Calling backend to validate with pr_number: $PR_NUMBER, user_handle: $USER_HANDLE, repo: $REPO_NAME, and owner: $OWNER_NAME" | ||
RESPONSE=$(curl --header "Content-Type: application/json" \ | ||
--request POST \ | ||
--data '{"pr_number": "'$PR_NUMBER'", "user_handle": "'$USER_HANDLE'", "repo": "'$REPO_NAME'", "owner": "'$OWNER_NAME'"}' \ | ||
"${BACKEND_URL}/application/flow/validate") | ||
echo "Response from validation: $RESPONSE" | ||
if [ "$RESPONSE" != "true" ]; then | ||
echo "Error: Validation returned false" | ||
exit 1 | ||
fi | ||
- name: Validation Success | ||
if: steps.validate.outcome == 'success' | ||
run: echo "Validation successful!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Convert Issue To Pull Request | ||
|
||
on: | ||
issues: | ||
types: | ||
- opened | ||
|
||
jobs: | ||
convert-issue-to-pr: | ||
runs-on: ubuntu-latest | ||
env: | ||
BACKEND_URL: https://fp-core-prod.dp04sa0tdc6pk.us-east-1.cs.amazonlightsail.com | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Convert Issue To PR | ||
run: | | ||
REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f2) | ||
echo "Converting Issue To PR with repo: $REPO_NAME" | ||
echo "Issue number: ${{ github.event.issue.number }}" | ||
curl --header "Content-Type: application/json" \ | ||
--request POST \ | ||
--data '{"issue_number": "'${{ github.event.issue.number }}'", "repo": "'$REPO_NAME'", "owner": "'${{ github.repository_owner }}'"}' \ | ||
"${BACKEND_URL}/application" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Json Structure Validator | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
branches: | ||
- main | ||
paths: | ||
- '**/*.json' | ||
|
||
jobs: | ||
validate_json: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }} | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install AJV CLI | ||
run: npm install -g ajv-cli | ||
|
||
- name: Validate JSON | ||
run: | | ||
echo "Searching for JSON files..." | ||
if [ "${{ github.event_name }}" == "pull_request" ]; then | ||
FILE_TO_VALIDATE=$(git diff --name-only HEAD^1 HEAD | grep '\.json$' | head -n 1) | ||
else | ||
FILE_TO_VALIDATE=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep '\.json$' | head -n 1) | ||
fi | ||
echo "$FILE_TO_VALIDATE" | ||
if [ -z "$FILE_TO_VALIDATE" ]; then | ||
echo "No JSON files found for validation." | ||
exit 0 | ||
fi | ||
echo "Validating JSON file..." | ||
if [ -f "$FILE_TO_VALIDATE" ]; then | ||
echo "Validating $FILE_TO_VALIDATE..." | ||
ajv validate -s validationSchema.json -d "$FILE_TO_VALIDATE" || exit 1 | ||
else | ||
echo "$FILE_TO_VALIDATE not found. Skipping..." | ||
fi | ||
echo "Validation complete." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Validate Application Proposal | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
|
||
jobs: | ||
validate-proposal: | ||
runs-on: ubuntu-latest | ||
env: | ||
BACKEND_URL: https://fp-core-prod.dp04sa0tdc6pk.us-east-1.cs.amazonlightsail.com | ||
steps: | ||
- name: Call Backend to Validate Application Proposal | ||
id: validate | ||
run: | | ||
USER_HANDLE="${{ github.actor }}" | ||
REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f2) | ||
OWNER_NAME="${{ github.repository_owner }}" | ||
PR_NUMBER="${{ github.event.pull_request.number }}" | ||
echo "Calling backend to validate with pr_number: $PR_NUMBER, user_handle: $USER_HANDLE, repo: $REPO_NAME, and owner: $OWNER_NAME" | ||
RESPONSE=$(curl --header "Content-Type: application/json" \ | ||
--request POST \ | ||
--data '{"pr_number": "'$PR_NUMBER'", "user_handle": "'$USER_HANDLE'", "repo": "'$REPO_NAME'", "owner": "'$OWNER_NAME'"}' \ | ||
"${BACKEND_URL}/application/proposal/validate") | ||
echo "Response from validation: $RESPONSE" | ||
if [ "$RESPONSE" != "true" ]; then | ||
echo "Error: Validation returned false" | ||
exit 1 | ||
fi | ||
- name: Validation Success | ||
if: steps.validate.outcome == 'success' | ||
run: echo "Validation successful!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Renew Cache | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
# Schedule to run at 1 AM every day | ||
- cron: '0 1 * * *' | ||
|
||
jobs: | ||
renew_cache: | ||
runs-on: ubuntu-latest | ||
env: | ||
BACKEND_URL: https://fp-core-prod.dp04sa0tdc6pk.us-east-1.cs.amazonlightsail.com | ||
steps: | ||
- name: Renew Application Cache | ||
run: | | ||
REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f2) | ||
curl -X POST "${BACKEND_URL}/application/cache/renewal" \ | ||
-H "Content-Type: application/json" \ | ||
-d '{"owner": "'${{ github.repository_owner }}'", "repo": "'$REPO_NAME'"}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Validate Application Trigger | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
|
||
jobs: | ||
validate-trigger: | ||
runs-on: ubuntu-latest | ||
env: | ||
BACKEND_URL: https://fp-core-prod.dp04sa0tdc6pk.us-east-1.cs.amazonlightsail.com | ||
steps: | ||
- name: Call Backend to Validate Application Trigger | ||
id: validate | ||
run: | | ||
USER_HANDLE="${{ github.actor }}" | ||
REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f2) | ||
OWNER_NAME="${{ github.repository_owner }}" | ||
PR_NUMBER="${{ github.event.pull_request.number }}" | ||
echo "Calling backend to validate with pr_number: $PR_NUMBER, user_handle: $USER_HANDLE, repo: $REPO_NAME, and owner: $OWNER_NAME" | ||
RESPONSE=$(curl --header "Content-Type: application/json" \ | ||
--request POST \ | ||
--data '{"pr_number": "'$PR_NUMBER'", "user_handle": "'$USER_HANDLE'", "repo": "'$REPO_NAME'", "owner": "'$OWNER_NAME'"}' \ | ||
"${BACKEND_URL}/application/trigger/validate") | ||
echo "Response from validation: $RESPONSE" | ||
if [ "$RESPONSE" != "true" ]; then | ||
echo "Error: Validation returned false" | ||
exit 1 | ||
fi | ||
- name: Validation Success | ||
if: steps.validate.outcome == 'success' | ||
run: echo "Validation successful!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.vscode | ||
.env |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"gov_team": [ | ||
"panges2", | ||
"simonkim0515", | ||
"dkkapur", | ||
"kevzak", | ||
"galen-mcandrew", | ||
"raghavrmadya", | ||
"Sunnyiscoming", | ||
"clriesco", | ||
"kokal33", | ||
"AlexMCon" | ||
] | ||
} |
Oops, something went wrong.