From 10422a68ba6b1dce2379124b01434745a5cce056 Mon Sep 17 00:00:00 2001 From: TWloYWkgQm9kbmFyaXU= Date: Fri, 15 Mar 2024 13:01:30 +0200 Subject: [PATCH 1/8] fix pr naming + add discord --- .github/workflows/v2-prepare-scoring.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/v2-prepare-scoring.yml b/.github/workflows/v2-prepare-scoring.yml index d9be22c4..da597334 100644 --- a/.github/workflows/v2-prepare-scoring.yml +++ b/.github/workflows/v2-prepare-scoring.yml @@ -25,7 +25,7 @@ jobs: scoring_id="$current_epoch.$slot_index" echo "scoring_id=$scoring_id" >> $GITHUB_ENV - scoring_path="scoring/$scoring_id" + scoring_path="scoring-v2/$scoring_id" echo "scoring_path=$scoring_path" >> $GITHUB_ENV mkdir -p "$scoring_path" @@ -82,7 +82,25 @@ jobs: git add scoring ! [ -z "$(git status --porcelain)" ] && git commit -m "scoring run $scoring_id" && git push -u origin "$scoring_branch" || echo "No changes to be committed" - pr_url=$(gh pr create -B scoring-v2 -H "$scoring_branch" --title "Publish Scoring Results ($scoring_id)" --body-file "${{ env.scoring_path }}/summary.md") + pr_url=$(gh pr create -B scoring-v2 -H "$scoring_branch" --title "Publish V2 Scoring Results ($scoring_id)" --body-file "${{ env.scoring_path }}/summary.md") echo "pr_url=$pr_url" >> $GITHUB_ENV env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Send Discord Notification + run: | + scoring_id="${{ env.scoring_id }}" + pr_url="${{ env.pr_url }}" + curl "$DISCORD_WEBHOOK" -H "Content-Type: application/json" -d '{ + "username": "Delegation Strategy", + "avatar_url": "https://public.marinade.finance/ds-scoring-bot.png", + "embeds": [ + { + "title": "Scoring V2 PR ('"$scoring_id"') is prepared.", + "url": "'"$pr_url"'", + "color": "5661687" + } + ] + }' + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} From aa0df0f25853a3c4f97ceacd2432f1340289bb95 Mon Sep 17 00:00:00 2001 From: TWloYWkgQm9kbmFyaXU= Date: Fri, 15 Mar 2024 13:05:03 +0200 Subject: [PATCH 2/8] fix --- .github/workflows/v2-prepare-scoring.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/v2-prepare-scoring.yml b/.github/workflows/v2-prepare-scoring.yml index da597334..4c6494e7 100644 --- a/.github/workflows/v2-prepare-scoring.yml +++ b/.github/workflows/v2-prepare-scoring.yml @@ -79,7 +79,7 @@ jobs: git config --global user.name 'Autonomous Scoring Pipeline' git config --global user.email 'bot@noreply.marinade.finance' git checkout -b "$scoring_branch" - git add scoring + git add scoring-v2 ! [ -z "$(git status --porcelain)" ] && git commit -m "scoring run $scoring_id" && git push -u origin "$scoring_branch" || echo "No changes to be committed" pr_url=$(gh pr create -B scoring-v2 -H "$scoring_branch" --title "Publish V2 Scoring Results ($scoring_id)" --body-file "${{ env.scoring_path }}/summary.md") From 87d09a87cae7f918340f874c38028daee9767708 Mon Sep 17 00:00:00 2001 From: TWloYWkgQm9kbmFyaXU= Date: Fri, 15 Mar 2024 14:48:23 +0200 Subject: [PATCH 3/8] test apply scoring v2 --- .github/workflows/v2-apply-scoring.yml | 235 +++++++++++++++++++++++ .github/workflows/v2-prepare-scoring.yml | 6 +- .github/workflows/v2-schedule.yml | 5 +- 3 files changed, 239 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/v2-apply-scoring.yml diff --git a/.github/workflows/v2-apply-scoring.yml b/.github/workflows/v2-apply-scoring.yml new file mode 100644 index 00000000..4adb34db --- /dev/null +++ b/.github/workflows/v2-apply-scoring.yml @@ -0,0 +1,235 @@ +name: Apply Scoring V2 + +on: + workflow_dispatch: + pull_request: + types: [closed] + branches: + - ds-scoring + +jobs: + apply_scoring: + runs-on: ubuntu-latest + if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'scoring-v2/')) + + steps: + - name: Set start timestamp + run: | + start_timestamp=$(date +%s) + echo "start_timestamp=$start_timestamp" >> $GITHUB_ENV + + - name: Checkout the repository + uses: actions/checkout@master + with: + ref: master + fetch-depth: 20 + + - name: Load scoring details + run: | + set -ex + scores_csv=$(git log -1 --name-only --pretty=format: --grep 'scoring run' | grep scores.csv) + params_json=$(git log -1 --name-only --pretty=format: --grep 'scoring run' | grep params.json) + + scoring_run_ui_id=$(git log -1 --name-only --pretty=format: --grep 'scoring run' | head -1 | awk -F / '{print $2}') + epoch=$(<<<"$scoring_run_ui_id" awk -F . '{print $1}') + weightStakeConcentrationASO=$(jq '.weightStakeConcentrationASO' $params_json) + echo "$weightStakeConcentrationASO" + + if [[ -z $scores_csv ]] + then + echo "Failed to find CSV with scores in the PR!" + exit 1 + fi + + if [[ -z $scoring_run_ui_id ]] + then + echo "Failed to detect scoring run UI ID from the PR!" + exit 1 + fi + + if [[ -z $epoch ]] + then + echo "Failed to detect epoch from the UI ID!" + exit 1 + fi + + echo "scores_csv=$scores_csv" >> $GITHUB_ENV + echo "scoring_run_ui_id=$scoring_run_ui_id" >> $GITHUB_ENV + echo "epoch=$epoch" >> $GITHUB_ENV + echo "COMPONENTS=COMMISSION_ADJUSTED_CREDITS,BLOCK_PRODUCTION,INFLATION_COMMISSION,MEV_COMMISSION,DC_COUNTRY_CONCENTRATION,DC_CITY_CONCENTRATION,DC_ASO_CONCENTRATION,DC_NODE_CONCENTRATION" >> $GITHUB_ENV + + # - name: Configure AWS credentials + # uses: aws-actions/configure-aws-credentials@v1 + # with: + # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # aws-region: ${{ secrets.AWS_DEFAULT_REGION }} + + # - name: Login to Amazon ECR + # id: login-ecr + # uses: aws-actions/amazon-ecr-login@v1 + + # - name: Prepare solana config + # run: | + # cat < /tmp/solana-config.yml + # json_rpc_url: "$RPC_URL" + # websocket_url: "" + # keypair_path: /.config/solana/id.json + # address_labels: + # "11111111111111111111111111111111": System Program + # commitment: confirmed + # EOF + # echo "$KEYPAIR" > /tmp/id.json + + # env: + # RPC_URL: ${{ secrets.RPC_URL }} + # KEYPAIR: ${{ secrets.VALIDATOR_MANAGEMENT_KEYPAIR }} + + # - name: Configure image + # run: | + # images=$(aws ecr describe-images --repository-name marinade.finance/validator-manager) + # latest=$(<<<"$images" jq '.imageDetails[] | .imagePushedAt + " " + .imageTags[0]' -r | sort | tail -1 | cut -d' ' -f2) + # echo "latest=$latest" >> $GITHUB_ENV + + # - name: Run scoring - simulation + # run: | + # docker run --rm --user "$(id -u):$(id -g)" \ + # -v /tmp/solana-config.yml:/.config/solana/cli/config.yml \ + # -v /tmp/id.json:/.config/solana/id.json \ + # -v "$(realpath "$SCORES_CSV"):/scores.csv" \ + # "$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" \ + # ./validator-manager -s --print-only update-scores2 --scores-file /scores.csv + # env: + # ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + # ECR_REPOSITORY: marinade.finance/validator-manager + # SCORES_CSV: ${{ env.scores_csv }} + # IMAGE_TAG: ${{ env.latest }} + + # - name: Publish scoring results + # run: | + # export $(grep -v '^#' "${{ env.params_env }}" | xargs -d '\n') + + # curl -sLfS "https://validators-api-dev.marinade.finance/admin/scores?epoch=${{ env.epoch }}&components=$COMPONENTS&component_weights=$COMPONENT_WEIGHTS&ui_id=${{ env.scoring_run_ui_id }}" -X POST \ + # -H "Content-Type: multipart/form-data" \ + # -H "Authorization: ${{ secrets.VALIDATORS_API_ADMIN_TOKEN }}" \ + # --form "scores_csv=@${{ env.scores_csv }}" + + # - name: Send Discord Notification + # run: | + # curl "$DISCORD_WEBHOOK" -H "Content-Type: application/json" -d '{ + # "username": "Delegation Strategy V2", + # "avatar_url": "https://public.marinade.finance/ds-scoring-bot.png", + # "embeds": [ + # { + # "title": "Scoring V2 successfully applied.", + # "color": "52224" + # } + # ] + # }' + # env: + # DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + + # emergency_unstake: + needs: apply_scoring + runs-on: ubuntu-latest + steps: + - name: Checkout the repository + uses: actions/checkout@master + with: + ref: master + fetch-depth: 20 + + - name: Load scoring details + run: | + set -ex + unstake_hints_json=$(git log -1 --name-only --pretty=format: --grep 'scoring run' | grep unstake-hints.json) + scoring_run_ui_id=$(git log -1 --name-only --pretty=format: --grep 'scoring run' | head -1 | awk -F / '{print $2}') + epoch=$(<<<"$scoring_run_ui_id" awk -F . '{print $1}') + + if [[ -z $unstake_hints_json ]] + then + echo "Failed to find JSON with unstake hints in the PR!" + exit 1 + fi + + if [[ -z $epoch ]] + then + echo "Failed to detect epoch from the UI ID!" + exit 1 + fi + + echo "unstake_hints_json=$unstake_hints_json" >> $GITHUB_ENV + echo "epoch=$epoch" >> $GITHUB_ENV + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_DEFAULT_REGION }} + + - name: Login to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v1 + + - name: Prepare solana config + run: | + cat < /tmp/solana-config.yml + json_rpc_url: "$RPC_URL" + websocket_url: "" + keypair_path: /.config/solana/id.json + address_labels: + "11111111111111111111111111111111": System Program + commitment: confirmed + EOF + echo "$KEYPAIR" > /tmp/id.json + + env: + RPC_URL: ${{ secrets.RPC_URL }} + KEYPAIR: ${{ secrets.VALIDATOR_MANAGEMENT_KEYPAIR }} + + - name: Configure image + run: | + images=$(aws ecr describe-images --repository-name marinade.finance/validator-manager) + latest=$(<<<"$images" jq '.imageDetails[] | .imagePushedAt + " " + .imageTags[0]' -r | sort | tail -1 | cut -d' ' -f2) + echo "latest=$latest" >> $GITHUB_ENV + + - name: Emergency unstake - simulation + run: | + <"$UNSTAKE_HINTS_JSON" jq '.unstake_hints[].vote_account' -r | xargs -I{} \ + docker run --rm --user "$(id -u):$(id -g)" \ + -v /tmp/solana-config.yml:/.config/solana/cli/config.yml \ + -v /tmp/id.json:/.config/solana/id.json \ + "$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" \ + ./validator-manager -s --print-only emergency-unstake {} + env: + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + ECR_REPOSITORY: marinade.finance/validator-manager + UNSTAKE_HINTS_JSON: ${{ env.unstake_hints_json }} + IMAGE_TAG: ${{ env.latest }} + + - name: Send Discord Notification + run: | + validators_count=$(<"$UNSTAKE_HINTS_JSON" jq '[.unstake_hints[].marinade_stake] | length' -r) + unstaked_sol=$(<"$UNSTAKE_HINTS_JSON" jq '[.unstake_hints[].marinade_stake] | add' -r) + + message="Emergency unstake successfully applied. ($validators_count validators, $unstaked_sol SOL)" + + if (( $validators_count == 0 )) + then + message="No emergency unstakes needed this time." + fi + + curl "$DISCORD_WEBHOOK" -H "Content-Type: application/json" -d '{ + "username": "Delegation Strategy V2 - Emergency Unstake", + "avatar_url": "https://public.marinade.finance/ds-emergency-bot.png", + "embeds": [ + { + "title": "'"$message"'", + "color": "52224" + } + ] + }' + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + UNSTAKE_HINTS_JSON: ${{ env.unstake_hints_json }} \ No newline at end of file diff --git a/.github/workflows/v2-prepare-scoring.yml b/.github/workflows/v2-prepare-scoring.yml index 4c6494e7..cc73b278 100644 --- a/.github/workflows/v2-prepare-scoring.yml +++ b/.github/workflows/v2-prepare-scoring.yml @@ -1,9 +1,9 @@ name: Prepare Scoring V2 on: - push: - branches: - - feat/ds-scoring + workflow_dispatch: + repository_dispatch: + types: [trigger_scoring] jobs: scoring: diff --git a/.github/workflows/v2-schedule.yml b/.github/workflows/v2-schedule.yml index 7ad56923..c55f2a6d 100644 --- a/.github/workflows/v2-schedule.yml +++ b/.github/workflows/v2-schedule.yml @@ -6,7 +6,7 @@ on: - cron: '50 0/1 * * *' jobs: trigger_scoring_if_needed: - name: Schedule Scoring + name: Schedule Scoring V2 runs-on: ubuntu-latest steps: - name: Checkout the repository @@ -43,9 +43,6 @@ jobs: exit 0 fi - # curl -sLfS "https://validators-api-dev.marinade.finance/admin/metrics?job_scheduled=true" -X POST \ - # -H "Authorization: ${{ secrets.VALIDATORS_API_ADMIN_TOKEN }}" - echo "Triggering the V2 scoring pipeline..." gh workflow run v2-prepare-scoring.yml env: From c2ff4da9f4d1de8ee532321987067a1afda27b81 Mon Sep 17 00:00:00 2001 From: TWloYWkgQm9kbmFyaXU= Date: Fri, 15 Mar 2024 14:49:10 +0200 Subject: [PATCH 4/8] fix --- .github/workflows/v2-apply-scoring.yml | 206 ++++++++++++------------- 1 file changed, 103 insertions(+), 103 deletions(-) diff --git a/.github/workflows/v2-apply-scoring.yml b/.github/workflows/v2-apply-scoring.yml index 4adb34db..295cf9c4 100644 --- a/.github/workflows/v2-apply-scoring.yml +++ b/.github/workflows/v2-apply-scoring.yml @@ -130,106 +130,106 @@ jobs: # DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} # emergency_unstake: - needs: apply_scoring - runs-on: ubuntu-latest - steps: - - name: Checkout the repository - uses: actions/checkout@master - with: - ref: master - fetch-depth: 20 - - - name: Load scoring details - run: | - set -ex - unstake_hints_json=$(git log -1 --name-only --pretty=format: --grep 'scoring run' | grep unstake-hints.json) - scoring_run_ui_id=$(git log -1 --name-only --pretty=format: --grep 'scoring run' | head -1 | awk -F / '{print $2}') - epoch=$(<<<"$scoring_run_ui_id" awk -F . '{print $1}') - - if [[ -z $unstake_hints_json ]] - then - echo "Failed to find JSON with unstake hints in the PR!" - exit 1 - fi - - if [[ -z $epoch ]] - then - echo "Failed to detect epoch from the UI ID!" - exit 1 - fi - - echo "unstake_hints_json=$unstake_hints_json" >> $GITHUB_ENV - echo "epoch=$epoch" >> $GITHUB_ENV - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ secrets.AWS_DEFAULT_REGION }} - - - name: Login to Amazon ECR - id: login-ecr - uses: aws-actions/amazon-ecr-login@v1 - - - name: Prepare solana config - run: | - cat < /tmp/solana-config.yml - json_rpc_url: "$RPC_URL" - websocket_url: "" - keypair_path: /.config/solana/id.json - address_labels: - "11111111111111111111111111111111": System Program - commitment: confirmed - EOF - echo "$KEYPAIR" > /tmp/id.json - - env: - RPC_URL: ${{ secrets.RPC_URL }} - KEYPAIR: ${{ secrets.VALIDATOR_MANAGEMENT_KEYPAIR }} - - - name: Configure image - run: | - images=$(aws ecr describe-images --repository-name marinade.finance/validator-manager) - latest=$(<<<"$images" jq '.imageDetails[] | .imagePushedAt + " " + .imageTags[0]' -r | sort | tail -1 | cut -d' ' -f2) - echo "latest=$latest" >> $GITHUB_ENV - - - name: Emergency unstake - simulation - run: | - <"$UNSTAKE_HINTS_JSON" jq '.unstake_hints[].vote_account' -r | xargs -I{} \ - docker run --rm --user "$(id -u):$(id -g)" \ - -v /tmp/solana-config.yml:/.config/solana/cli/config.yml \ - -v /tmp/id.json:/.config/solana/id.json \ - "$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" \ - ./validator-manager -s --print-only emergency-unstake {} - env: - ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} - ECR_REPOSITORY: marinade.finance/validator-manager - UNSTAKE_HINTS_JSON: ${{ env.unstake_hints_json }} - IMAGE_TAG: ${{ env.latest }} - - - name: Send Discord Notification - run: | - validators_count=$(<"$UNSTAKE_HINTS_JSON" jq '[.unstake_hints[].marinade_stake] | length' -r) - unstaked_sol=$(<"$UNSTAKE_HINTS_JSON" jq '[.unstake_hints[].marinade_stake] | add' -r) - - message="Emergency unstake successfully applied. ($validators_count validators, $unstaked_sol SOL)" - - if (( $validators_count == 0 )) - then - message="No emergency unstakes needed this time." - fi - - curl "$DISCORD_WEBHOOK" -H "Content-Type: application/json" -d '{ - "username": "Delegation Strategy V2 - Emergency Unstake", - "avatar_url": "https://public.marinade.finance/ds-emergency-bot.png", - "embeds": [ - { - "title": "'"$message"'", - "color": "52224" - } - ] - }' - env: - DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} - UNSTAKE_HINTS_JSON: ${{ env.unstake_hints_json }} \ No newline at end of file + # needs: apply_scoring + # runs-on: ubuntu-latest + # steps: + # - name: Checkout the repository + # uses: actions/checkout@master + # with: + # ref: master + # fetch-depth: 20 + + # - name: Load scoring details + # run: | + # set -ex + # unstake_hints_json=$(git log -1 --name-only --pretty=format: --grep 'scoring run' | grep unstake-hints.json) + # scoring_run_ui_id=$(git log -1 --name-only --pretty=format: --grep 'scoring run' | head -1 | awk -F / '{print $2}') + # epoch=$(<<<"$scoring_run_ui_id" awk -F . '{print $1}') + + # if [[ -z $unstake_hints_json ]] + # then + # echo "Failed to find JSON with unstake hints in the PR!" + # exit 1 + # fi + + # if [[ -z $epoch ]] + # then + # echo "Failed to detect epoch from the UI ID!" + # exit 1 + # fi + + # echo "unstake_hints_json=$unstake_hints_json" >> $GITHUB_ENV + # echo "epoch=$epoch" >> $GITHUB_ENV + + # - name: Configure AWS credentials + # uses: aws-actions/configure-aws-credentials@v1 + # with: + # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # aws-region: ${{ secrets.AWS_DEFAULT_REGION }} + + # - name: Login to Amazon ECR + # id: login-ecr + # uses: aws-actions/amazon-ecr-login@v1 + + # - name: Prepare solana config + # run: | + # cat < /tmp/solana-config.yml + # json_rpc_url: "$RPC_URL" + # websocket_url: "" + # keypair_path: /.config/solana/id.json + # address_labels: + # "11111111111111111111111111111111": System Program + # commitment: confirmed + # EOF + # echo "$KEYPAIR" > /tmp/id.json + + # env: + # RPC_URL: ${{ secrets.RPC_URL }} + # KEYPAIR: ${{ secrets.VALIDATOR_MANAGEMENT_KEYPAIR }} + + # - name: Configure image + # run: | + # images=$(aws ecr describe-images --repository-name marinade.finance/validator-manager) + # latest=$(<<<"$images" jq '.imageDetails[] | .imagePushedAt + " " + .imageTags[0]' -r | sort | tail -1 | cut -d' ' -f2) + # echo "latest=$latest" >> $GITHUB_ENV + + # - name: Emergency unstake - simulation + # run: | + # <"$UNSTAKE_HINTS_JSON" jq '.unstake_hints[].vote_account' -r | xargs -I{} \ + # docker run --rm --user "$(id -u):$(id -g)" \ + # -v /tmp/solana-config.yml:/.config/solana/cli/config.yml \ + # -v /tmp/id.json:/.config/solana/id.json \ + # "$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" \ + # ./validator-manager -s --print-only emergency-unstake {} + # env: + # ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + # ECR_REPOSITORY: marinade.finance/validator-manager + # UNSTAKE_HINTS_JSON: ${{ env.unstake_hints_json }} + # IMAGE_TAG: ${{ env.latest }} + + # - name: Send Discord Notification + # run: | + # validators_count=$(<"$UNSTAKE_HINTS_JSON" jq '[.unstake_hints[].marinade_stake] | length' -r) + # unstaked_sol=$(<"$UNSTAKE_HINTS_JSON" jq '[.unstake_hints[].marinade_stake] | add' -r) + + # message="Emergency unstake successfully applied. ($validators_count validators, $unstaked_sol SOL)" + + # if (( $validators_count == 0 )) + # then + # message="No emergency unstakes needed this time." + # fi + + # curl "$DISCORD_WEBHOOK" -H "Content-Type: application/json" -d '{ + # "username": "Delegation Strategy V2 - Emergency Unstake", + # "avatar_url": "https://public.marinade.finance/ds-emergency-bot.png", + # "embeds": [ + # { + # "title": "'"$message"'", + # "color": "52224" + # } + # ] + # }' + # env: + # DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + # UNSTAKE_HINTS_JSON: ${{ env.unstake_hints_json }} \ No newline at end of file From 74983b49efd88c2bcc62f5c54333f2d529de278b Mon Sep 17 00:00:00 2001 From: TWloYWkgQm9kbmFyaXU= Date: Fri, 15 Mar 2024 14:53:44 +0200 Subject: [PATCH 5/8] fix branch name --- .github/workflows/v2-apply-scoring.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/v2-apply-scoring.yml b/.github/workflows/v2-apply-scoring.yml index 295cf9c4..420b8af4 100644 --- a/.github/workflows/v2-apply-scoring.yml +++ b/.github/workflows/v2-apply-scoring.yml @@ -5,7 +5,7 @@ on: pull_request: types: [closed] branches: - - ds-scoring + - scoring-v2 jobs: apply_scoring: From 274111cb110857f516fdf50683203b34e591d417 Mon Sep 17 00:00:00 2001 From: TWloYWkgQm9kbmFyaXU= Date: Fri, 15 Mar 2024 15:04:35 +0200 Subject: [PATCH 6/8] fix: branch name --- .github/workflows/apply-scoring.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/apply-scoring.yml b/.github/workflows/apply-scoring.yml index 233754d8..b52c5e8b 100644 --- a/.github/workflows/apply-scoring.yml +++ b/.github/workflows/apply-scoring.yml @@ -10,7 +10,7 @@ on: jobs: apply_scoring: runs-on: ubuntu-latest - if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'scoring/')) + if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'ds-scoring/')) steps: - name: Set start timestamp From 147508dd6a6ad556cd7ffdb0f3824c9e846bba21 Mon Sep 17 00:00:00 2001 From: TWloYWkgQm9kbmFyaXU= Date: Fri, 15 Mar 2024 15:07:09 +0200 Subject: [PATCH 7/8] fix --- .github/workflows/apply-scoring.yml | 2 +- .github/workflows/v2-apply-scoring.yml | 2 +- .github/workflows/v2-prepare-scoring.yml | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/apply-scoring.yml b/.github/workflows/apply-scoring.yml index b52c5e8b..233754d8 100644 --- a/.github/workflows/apply-scoring.yml +++ b/.github/workflows/apply-scoring.yml @@ -10,7 +10,7 @@ on: jobs: apply_scoring: runs-on: ubuntu-latest - if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'ds-scoring/')) + if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'scoring/')) steps: - name: Set start timestamp diff --git a/.github/workflows/v2-apply-scoring.yml b/.github/workflows/v2-apply-scoring.yml index 420b8af4..119fa954 100644 --- a/.github/workflows/v2-apply-scoring.yml +++ b/.github/workflows/v2-apply-scoring.yml @@ -10,7 +10,7 @@ on: jobs: apply_scoring: runs-on: ubuntu-latest - if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'scoring-v2/')) + if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'ds-scoring/')) steps: - name: Set start timestamp diff --git a/.github/workflows/v2-prepare-scoring.yml b/.github/workflows/v2-prepare-scoring.yml index cc73b278..4c6494e7 100644 --- a/.github/workflows/v2-prepare-scoring.yml +++ b/.github/workflows/v2-prepare-scoring.yml @@ -1,9 +1,9 @@ name: Prepare Scoring V2 on: - workflow_dispatch: - repository_dispatch: - types: [trigger_scoring] + push: + branches: + - feat/ds-scoring jobs: scoring: From b42286127ce367ad68fa49c7e2841e417d49884e Mon Sep 17 00:00:00 2001 From: TWloYWkgQm9kbmFyaXU= Date: Fri, 15 Mar 2024 15:16:54 +0200 Subject: [PATCH 8/8] check if params exists --- .github/workflows/v2-apply-scoring.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/v2-apply-scoring.yml b/.github/workflows/v2-apply-scoring.yml index 119fa954..de0a8182 100644 --- a/.github/workflows/v2-apply-scoring.yml +++ b/.github/workflows/v2-apply-scoring.yml @@ -40,6 +40,12 @@ jobs: echo "Failed to find CSV with scores in the PR!" exit 1 fi + + if [[ -z $params_json ]] + then + echo "Failed to find JSON with params in the PR!" + exit 1 + fi if [[ -z $scoring_run_ui_id ]] then