Repository: causify-ai/helpers
Pull request #374: CmampTask11193_Setup_GCR_for_all_workflows_across_all_repos
Author: login: dremdem
Labels: name: PR for reviewers
description: The PR needs to be reviewed by RPs
Created: 2025-03-13T16:01:44Z | Merged: 2025-03-25T12:56:39Z

[#11193](https://github.com/causify-ai/csfy/issues/5423)

- enable the GHRC usage in the following  GH workflows:
   -  [x] `linter.yml`
   - [x] `fast_tests.yml`
   - [x] `slow_tests.yml`
   - [x] `superslow_tests.yml`


Diff:
diff --git a/.github/workflows/fast_tests.yml b/.github/workflows/fast_tests.yml
index 385088753..6df79f9b4 100644
--- a/.github/workflows/fast_tests.yml
+++ b/.github/workflows/fast_tests.yml
@@ -27,15 +27,19 @@ permissions:
   id-token: write
   # This is required for actions/checkout.
   contents: read
+  # This is required for pulling the Docker image from GHCR.
+  packages: read
 jobs:
   run_fast_tests:
+    # We expect user to not execute manual run in a draft PR.
+    # The reason is `github.event.pull_request.draft` is evaluated as empty
+    # string and the condition is always true which is not the right state.
+    if: ${{ github.event.pull_request.draft == false }}
     runs-on: ubuntu-latest
 
     steps:
-      # To optimize costs, the image is fetched from GHCR registry by default. If you prefer
-      # pulling the image from ECR, enable this.
-      # Pass AWS credentials via GH secrets. This is needed to pull the Docker image
-      # that will be used to run the action.
+      # Pass AWS credentials via GH secrets. This is needed to pull the Docker
+      # image and in case the tests need to access AWS resources.
       - name: Configure AWS credentials
         uses: aws-actions/configure-aws-credentials@v1
         with:
@@ -43,13 +47,14 @@ jobs:
           role-session-name: ${{ vars.GH_ACTION_AWS_SESSION_NAME }}
           aws-region: ${{ vars.CSFY_AWS_DEFAULT_REGION }}
 
-      # This is needed to pull the Docker image.
-      - name: Login to Amazon ECR
-        id: login-ecr
-        uses: aws-actions/amazon-ecr-login@v1
+      # # To optimize costs, the image is fetched from GHCR registry by default.
+      # # If you prefer pulling the image from ECR, enable this.
+      # - name: Login to AWS ECR
+      #   id: login-ecr
+      #   uses: aws-actions/amazon-ecr-login@v1
 
-      #- name: Perform docker login
-      #  run: docker login ghcr.io -u gpsaggese -p ${{ secrets.GITHUB_TOKEN }}
+      - name: Login to GHCR
+        run: docker login ghcr.io -u gpsaggese -p ${{ secrets.GITHUB_TOKEN }}
 
       # Make everything accessible by any user to avoid permission errors.
       - name: Cleanup
@@ -70,40 +75,38 @@ jobs:
 
       # Install packages that are required to run the job via GH.
       - name: Install dependencies
-        if: github.event.pull_request.draft == false
         run: |
           python -m pip install --upgrade pip
           pip install -r .github/gh_requirements.txt
 
-      # Pull the latest Docker image to run the regressions on.
-      - name: Pull image
-        if: github.event.pull_request.draft == false
-        env:
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
-        run: invoke docker_pull
+      # # Pull the latest Docker image from the AWS ECR to run the regressions
+      # # on.
+      # - name: Pull image from AWS ECR
+      #   env:
+      #     CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+      #   run: invoke docker_pull
 
-      # Pull the latest Docker image from GHCR registry instead of ECR for cost saving purposes to run the regressions on.
-      #- name: Pull image
-      #  if: github.event.pull_request.draft == false
-      #  run: docker pull ghcr.io/cryptokaizen/cmamp:dev
+      # Pull the latest Docker image from the GHCR registry instead of ECR for
+      # cost saving purposes to run the regressions on.
+      - name: Pull image from GHCR
+        run: docker pull ghcr.io/${{ github.repository }}:dev
 
-      # Run the `invoke` target `run_fast_tests` to run tests that are under 5 seconds.
-      # See the corresponding documentation for more information.
+      # Run the `invoke` target `run_fast_tests` to run tests that are under 5
+      # seconds. See the corresponding documentation for more information.
       - name: Run fast tests
-        # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/19
-        # Do not run on draft pull requests.
-        if: github.event.pull_request.draft == false
         env:
           CSFY_AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
           CSFY_AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
           CSFY_AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }}
           CSFY_AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }}
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
-          # If you prefer pulling the image from ECR, comment out the following line and uncomment the one above.
-          # Base path for GHCR registry.
-          #CSFY_ECR_BASE_PATH: ghcr.io/cryptokaizen
+          # CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH is the source path for fetching the image.
+          # If you prefer pulling the image from ECR, comment out the following
+          # line and uncomment the one above.
+          # TODO(Vlad): Rename the variable to CSFY_CR_BASE_PATH since it can be
+          # either GHCR or ECR.
+          CSFY_ECR_BASE_PATH: ghcr.io/${{ github.repository_owner }}
           CSFY_AWS_S3_BUCKET: ${{ vars.CSFY_AWS_S3_BUCKET }}
-          CSFY_TELEGRAM_TOKEN: ${{ secrets.CSFY_TELEGRAM_TOKEN }}
           GH_ACTION_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
         run: invoke run_fast_tests
         # TODO(gp): Run a single test. You need to disable the `push` on master.
@@ -132,8 +135,8 @@ jobs:
         if: ${{ failure() && github.ref_name == 'master' }}
         uses: slackapi/slack-github-action@v1.27.0
         with:
-          # You can pass in multiple channels to post to by providing a comma-delimited list of channel IDs:
-          # 'CHANNEL_ID,ANOTHER_CHANNEL_ID'
+          # You can pass in multiple channels to post to by providing a
+          # comma-delimited list of channel IDs: 'CHANNEL_ID,ANOTHER_CHANNEL_ID'
           channel-id: ${{ vars.SLACK_BUILD_NOTIF_CHANNEL_ID }}
           slack-message: |
             💣 FAST TESTS FAILED
diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml
index f2175ba04..fed19ae84 100644
--- a/.github/workflows/linter.yml
+++ b/.github/workflows/linter.yml
@@ -15,42 +15,45 @@ permissions:
   id-token: write
   # This is required for actions/checkout.
   contents: read
+  # This is required for pulling the Docker image from GHCR.
+  packages: read
 
 jobs:
 
   Run_linter:
+    # We expect user to not execute manual run in a draft PR.
+    # The reason is `github.event.pull_request.draft` is evaluated as empty
+    # string and the condition is always true which is not the right state.
+    if: ${{ github.event.pull_request.draft == false }}
     runs-on: ubuntu-latest
 
     steps:
-      # To optimize costs, the image is fetched from GHCR registry by default. If you prefer
-      # pulling the image from ECR, enable this.
-      # # Pass AWS credentials via GH secrets. This is needed to pull the Docker image
-      # # that will be used to run the action.
-      - name: Configure AWS credentials
-        uses: aws-actions/configure-aws-credentials@v1
-        with:
-          role-to-assume: ${{ vars.GH_ACTION_AWS_ROLE_ARN }}
-          role-session-name: ${{ vars.GH_ACTION_AWS_SESSION_NAME }}
-          aws-region: ${{ vars.CSFY_AWS_DEFAULT_REGION }}
+      # To optimize costs, the image is fetched from GHCR registry by default.
+      # If you prefer pulling the image from ECR, enable this.
+      # # Pass AWS credentials via GH secrets. This is needed to pull the Docker
+      # # image that will be used to run the action.
+      # - name: Configure AWS credentials
+      #   uses: aws-actions/configure-aws-credentials@v1
+      #   with:
+      #     role-to-assume: ${{ vars.GH_ACTION_AWS_ROLE_ARN }}
+      #     role-session-name: ${{ vars.GH_ACTION_AWS_SESSION_NAME }}
+      #     aws-region: ${{ vars.CSFY_AWS_DEFAULT_REGION }}
 
-      # # This is needed to pull the Docker image.
-      - name: Login to Amazon ECR
-        id: login-ecr
-        uses: aws-actions/amazon-ecr-login@v1
+      # # # This is needed to pull the Docker image.
+      # - name: Login to AWS ECR
+      #   id: login-ecr
+      #   uses: aws-actions/amazon-ecr-login@v1
 
-      #- name: Perform docker login
-      #  if: github.event.pull_request.draft == false
-      #  run: docker login ghcr.io -u gpsaggese -p ${{ secrets.GITHUB_TOKEN }}
+      - name: Login to GHCR
+        run: docker login ghcr.io -u gpsaggese -p ${{ secrets.GITHUB_TOKEN }}
 
       # Make everything accessible by any user to avoid permission errors.
       - name: Cleanup
-        if: github.event.pull_request.draft == false
         run: sudo chmod 777 -R .
 
       # Check out the code from GitHub so that we can run the action inside
       # the Docker container.
       - name: Checkout code
-        if: github.event.pull_request.draft == false
         uses: actions/checkout@v2
         with:
           # The `lint` invoke target needs to have the full history of commits
@@ -61,37 +64,27 @@ jobs:
 
       # Install packages that are required to run the job via GH.
       - name: Install dependencies
-        if: github.event.pull_request.draft == false
         run: |
           python -m pip install --upgrade pip
           pip install -r .github/gh_requirements.txt
 
       # Pull the `helpers:prod` image to run the Linter on it.
-      - name: Pull helpers:prod image
-        if: github.event.pull_request.draft == false
+      - name: Pull Linter image
         env:
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          CSFY_ECR_BASE_PATH: ghcr.io/causify-ai
         run: invoke docker_pull_helpers
 
       # Run the linter, then check if any file was changed after that. If so,
       # fail the job.
       - name: Check if the Linter was run
-        # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/19
-        # Do not run on draft pull requests.
-        if: github.event.pull_request.draft == false
         env:
-          CSFY_AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
-          CSFY_AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
-          CSFY_AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }}
-          CSFY_AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }}
-          # Base path for ECR registry.
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
-          # If you prefer pulling the image from GHCR, uncomment out the following line and comment the one above.
-          # Base path for GHCR registry.
-          # CSFY_ECR_BASE_PATH: ghcr.io/cryptokaizen
-          CSFY_AWS_S3_BUCKET: ${{ vars.CSFY_AWS_S3_BUCKET }}
-          CSFY_TELEGRAM_TOKEN: ${{ secrets.CSFY_TELEGRAM_TOKEN }}
-          GH_ACTION_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          # CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH is the source path for fetching the image.
+          # If you prefer pulling the image from ECR, comment out the following
+          # line and uncomment the one above.
+          # TODO(Vlad): Rename the variable to CSFY_CR_BASE_PATH since it can be
+          # either GHCR or ECR.
+          CSFY_ECR_BASE_PATH: ghcr.io/${{ github.repository_owner }}
         # To run the linter, fetch the master branch for comparison with the
         # current branch.
         run: |
diff --git a/.github/workflows/slow_tests.yml b/.github/workflows/slow_tests.yml
index ee68bc4c8..498748bd6 100644
--- a/.github/workflows/slow_tests.yml
+++ b/.github/workflows/slow_tests.yml
@@ -30,16 +30,20 @@ permissions:
   id-token: write
   # This is required for actions/checkout.
   contents: read
+  # This is required for pulling the Docker image from GHCR.
+  packages: read
 
 jobs:
   run_slow_tests:
+    # We expect user to not execute manual run in a draft PR.
+    # The reason is `github.event.pull_request.draft` is evaluated as empty
+    # string and the condition is always true which is not the right state.
+    if: ${{ github.event.pull_request.draft == false }}
     runs-on: ubuntu-latest
 
     steps:
-      # To optimize costs, the image is fetched from GHCR registry by default. If you prefer
-      # pulling the image from ECR, enable this.
-      # Pass AWS credentials via GH secrets. This is needed to pull the Docker image
-      # that will be used to run the action.
+      # Pass AWS credentials via GH secrets. This is needed to pull the Docker
+      # image and in case the tests need to access AWS resources.
       - name: Configure AWS credentials
         uses: aws-actions/configure-aws-credentials@v1
         with:
@@ -47,13 +51,15 @@ jobs:
           role-session-name: ${{ vars.GH_ACTION_AWS_SESSION_NAME }}
           aws-region: ${{ vars.CSFY_AWS_DEFAULT_REGION }}
 
+      # To optimize costs, the image is fetched from GHCR registry by default.
+      # If you prefer pulling the image from ECR, enable this.
       # This is needed to pull the Docker image.
-      - name: Login to Amazon ECR
-        id: login-ecr
-        uses: aws-actions/amazon-ecr-login@v1
+      # - name: Login to AWS ECR
+      #   id: login-ecr
+      #   uses: aws-actions/amazon-ecr-login@v1
 
-      #- name: Perform docker login
-      #  run: docker login ghcr.io -u gpsaggese -p ${{ secrets.GITHUB_TOKEN }}
+      - name: Login to GHCR
+        run: docker login ghcr.io -u gpsaggese -p ${{ secrets.GITHUB_TOKEN }}
 
       # Make everything accessible by any user to avoid permission errors.
       - name: Cleanup
@@ -74,24 +80,24 @@ jobs:
 
       # Install packages that are required to run the job via GH.
       - name: Install dependencies
-        if: github.event.pull_request.draft == false
         run: |
           python -m pip install --upgrade pip
           pip install -r .github/gh_requirements.txt
 
-      # Pull the latest Docker image to run the regressions on.
-      - name: Pull image
-        if: github.event.pull_request.draft == false
-        env:
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
-        run: invoke docker_pull
+      # # Pull the latest Docker image from the AWS ECR to run the regressions
+      # # on.
+      # - name: Pull image from AWS ECR
+      #   env:
+      #     CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+      #   run: invoke docker_pull
 
-      # Pull the latest Docker image from GHCR registry instead of ECR for cost saving purposes to run the regressions on.
-      #- name: Pull image
-      #  if: github.event.pull_request.draft == false
-      #  run: docker pull ghcr.io/cryptokaizen/cmamp:dev
+      # Pull the latest Docker image from the GHCR registry instead of ECR for
+      # cost saving purposes to run the regressions on.
+      - name: Pull image from GHCR
+        run: docker pull ghcr.io/${{ github.repository }}:dev
 
-      # Run the `invoke` target `run_slow_tests` to run tests that are over 5 seconds.
+      # Run the `invoke` target `run_slow_tests` to run tests that are over 5
+      # seconds.
       # See the corresponding documentation for more information.
       - name: Run slow tests
         env:
@@ -99,16 +105,15 @@ jobs:
           CSFY_AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
           CSFY_AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }}
           CSFY_AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }}
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
-          # If you prefer pulling the image from ECR, comment out the following line and uncomment the one above.
-          # Base path for GHCR registry.
-          #CSFY_ECR_BASE_PATH: ghcr.io/cryptokaizen
+          # CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH is the source path for fetching the image.
+          # If you prefer pulling the image from ECR, comment out the following
+          # line and uncomment the one above.
+          # TODO(Vlad): Rename the variable to CSFY_CR_BASE_PATH since it can be
+          # either GHCR or ECR.
+          CSFY_ECR_BASE_PATH: ghcr.io/${{ github.repository_owner }}
           CSFY_AWS_S3_BUCKET: ${{ vars.CSFY_AWS_S3_BUCKET }}
-          CSFY_TELEGRAM_TOKEN: ${{ secrets.CSFY_TELEGRAM_TOKEN }}
           GH_ACTION_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-        # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/19
-        # Do not run on draft pull requests.
-        if: github.event.pull_request.draft == false
         run: invoke run_slow_tests
 
       # In case of manual run, this workflow step will not be skipped and
@@ -133,8 +138,8 @@ jobs:
         if: ${{ failure() && github.ref_name == 'master' }}
         uses: slackapi/slack-github-action@v1.27.0
         with:
-          # You can pass in multiple channels to post to by providing a comma-delimited list of channel IDs:
-          # 'CHANNEL_ID,ANOTHER_CHANNEL_ID'
+          # You can pass in multiple channels to post to by providing a
+          # comma-delimited list of channel IDs: 'CHANNEL_ID,ANOTHER_CHANNEL_ID'
           channel-id: ${{ vars.SLACK_BUILD_NOTIF_CHANNEL_ID }}
           slack-message: |
             💣 SLOW TESTS FAILED
diff --git a/.github/workflows/superslow_tests.yml b/.github/workflows/superslow_tests.yml
index 04a209112..9261a7af3 100644
--- a/.github/workflows/superslow_tests.yml
+++ b/.github/workflows/superslow_tests.yml
@@ -15,14 +15,16 @@ permissions:
   id-token: write
   # This is required for actions/checkout.
   contents: read
+  # This is required for pulling the Docker image from GHCR.
+  packages: read
 
 jobs:
   run_superslow_tests:
     runs-on: ubuntu-latest
 
     steps:
-      # Pass AWS credentials via GH secrets. This is needed to pull the Docker image
-      # that will be used to run the action.
+      # Pass AWS credentials via GH secrets. This is needed to pull the Docker
+      # image and in case the tests need to access AWS resources.
       - name: Configure AWS credentials
         uses: aws-actions/configure-aws-credentials@v1
         with:
@@ -30,10 +32,14 @@ jobs:
           role-session-name: ${{ vars.GH_ACTION_AWS_SESSION_NAME }}
           aws-region: ${{ vars.CSFY_AWS_DEFAULT_REGION }}
 
-      # This is needed to pull the Docker image.
-      - name: Login to Amazon ECR
-        id: login-ecr
-        uses: aws-actions/amazon-ecr-login@v1
+      # # To optimize costs, the image is fetched from GHCR registry by default.
+      # # This is needed to pull the Docker image.
+      # - name: Login to AWS ECR
+      #   id: login-ecr
+      #   uses: aws-actions/amazon-ecr-login@v1
+
+      - name: Login to GHCR
+        run: docker login ghcr.io -u gpsaggese -p ${{ secrets.GITHUB_TOKEN }}
 
       # Make everything accessible by any user to avoid permission errors.
       - name: Cleanup
@@ -54,20 +60,24 @@ jobs:
 
       # Install packages that are required to run the job via GH.
       - name: Install dependencies
-        if: github.event.pull_request.draft == false
         run: |
           python -m pip install --upgrade pip
           pip install -r .github/gh_requirements.txt
 
-      # Pull the latest Docker image to run the regressions on.
-      - name: Pull image
-        if: github.event.pull_request.draft == false
-        env:
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
-        run: invoke docker_pull
+      # # Pull the latest Docker image from the AWS ECR to run the regressions
+      # # on.
+      # - name: Pull image from AWS ECR
+      #   env:
+      #     CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+      #   run: invoke docker_pull
+
+      # Pull the latest Docker image from the GHCR registry instead of ECR for
+      # cost saving purposes to run the regressions on.
+      - name: Pull image from GHCR
+        run: docker pull ghcr.io/${{ github.repository }}:dev
 
-      # Run the `invoke` target `run_superslow_tests` to run tests that are over 30 seconds.
-      # See the corresponding documentation for more information.
+      # Run the `invoke` target `run_superslow_tests` to run tests that are over
+      # 30 seconds. See the corresponding documentation for more information.
       - name: Run superslow tests
         env:
           GH_ACTION_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -75,9 +85,14 @@ jobs:
           CSFY_AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
           CSFY_AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }}
           CSFY_AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }}
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH is the source path for fetching the image.
+          # If you prefer pulling the image from ECR, comment out the following
+          # line and uncomment the one above.
+          # TODO(Vlad): Rename the variable to CSFY_CR_BASE_PATH since it can be
+          # either GHCR or ECR.
+          CSFY_ECR_BASE_PATH: ghcr.io/${{ github.repository_owner }}
           CSFY_AWS_S3_BUCKET: ${{ vars.CSFY_AWS_S3_BUCKET }}
-          CSFY_TELEGRAM_TOKEN: ${{ secrets.CSFY_TELEGRAM_TOKEN }}
         run: invoke run_superslow_tests
 
       # In case of manual run, this workflow step will not be skipped and
@@ -103,8 +118,8 @@ jobs:
         if: ${{ failure() && github.ref_name == 'master' }}
         uses: slackapi/slack-github-action@v1.27.0
         with:
-          # You can pass in multiple channels to post to by providing a comma-delimited list of channel IDs:
-          # 'CHANNEL_ID,ANOTHER_CHANNEL_ID'
+          # You can pass in multiple channels to post to by providing a
+          # comma-delimited list of channel IDs: 'CHANNEL_ID,ANOTHER_CHANNEL_ID'
           channel-id: ${{ vars.SLACK_BUILD_NOTIF_CHANNEL_ID }}
           slack-message: |
             💣 SUPERSLOW TESTS FAILED


Reviews:
user: login: samarth9008
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-13T18:03:49Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-13T19:42:41Z
user: login: samarth9008
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-14T01:21:11Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-14T10:53:02Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-14T10:53:29Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-14T10:54:44Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-14T10:55:31Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-14T10:55:49Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-14T11:10:45Z
user: login: samarth9008
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-14T12:51:06Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-14T14:14:31Z
user: login: samarth9008
body: Minor changes. Feel free to start working on other workflows of helpers for now.
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-14T15:14:47Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-14T15:25:33Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-14T15:26:28Z
user: login: gpsaggese
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-16T17:31:12Z
user: login: gpsaggese
body: Ok, but one can see all the layers of changes in the comments.
Let's make it nice and clear what we are doing and why.
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-17T20:51:40Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-18T12:02:41Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-18T12:04:54Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-18T15:39:01Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-18T16:20:05Z
user: login: heanhsok
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-19T14:32:08Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-19T14:45:03Z
user: login: heanhsok
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-19T14:58:07Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-19T15:30:46Z
user: login: samarth9008
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-19T15:40:55Z
user: login: heanhsok
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-19T15:41:57Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-19T15:53:51Z
user: login: samarth9008
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-19T16:37:44Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-19T17:02:59Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-19T17:05:49Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-19T17:06:12Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-19T17:07:27Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-19T17:14:31Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-19T17:18:32Z
user: login: samarth9008
body: Just 1 comment else LG
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-20T00:45:58Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-20T12:10:47Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-20T12:34:03Z
user: login: samarth9008
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-20T15:42:49Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-20T15:51:41Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-20T16:03:34Z
user: login: samarth9008
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-20T16:50:12Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-20T18:49:21Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T15:57:59Z
user: login: samarth9008
body: Feel free to merge after this change
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T19:59:00Z
user: login: dremdem
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-25T12:39:28Z

Review comments:
diff_hunk: @@ -38,9 +38,10 @@ jobs:
         id: login-ecr
         uses: aws-actions/amazon-ecr-login@v1
 
-      #- name: Perform docker login
-      #  if: github.event.pull_request.draft == false
-      #  run: docker login ghcr.io -u gpsaggese -p ${{ secrets.GITHUB_TOKEN }}
+      - name: Perform docker login
+        if: github.event.pull_request.draft == false
+        run: docker login ghcr.io -u gpsaggese -p ${{ secrets.GITHUB_TOKEN }}
path: .github/workflows/linter.yml
user: login: samarth9008
body: Can you check if there is any other way to login without using any specific username? Some kind of in-built action
created_at: 2025-03-13T18:03:08Z
author_association: CONTRIBUTOR
diff_hunk: @@ -38,9 +38,10 @@ jobs:
         id: login-ecr
         uses: aws-actions/amazon-ecr-login@v1
 
-      #- name: Perform docker login
-      #  if: github.event.pull_request.draft == false
-      #  run: docker login ghcr.io -u gpsaggese -p ${{ secrets.GITHUB_TOKEN }}
+      - name: Perform docker login
+        if: github.event.pull_request.draft == false
+        run: docker login ghcr.io -u gpsaggese -p ${{ secrets.GITHUB_TOKEN }}
path: .github/workflows/linter.yml
user: login: dremdem
body: Found solution of the issue: need to add permissions, see above.
created_at: 2025-03-13T19:42:41Z
author_association: CONTRIBUTOR
diff_hunk: @@ -15,6 +15,8 @@ permissions:
   id-token: write
   # This is required for actions/checkout.
   contents: read
+  # This is required for pulling the Docker image from GHCR.
+  packages: read
path: .github/workflows/linter.yml
user: login: samarth9008
body: FYI @heanhsok 
created_at: 2025-03-14T01:05:47Z
author_association: CONTRIBUTOR
diff_hunk: @@ -38,9 +40,9 @@ jobs:
         id: login-ecr
path: .github/workflows/linter.yml
user: login: samarth9008
body: We can disable/comment out AWS login and `Configure AWS credentials` related steps and not required IMO 
created_at: 2025-03-14T01:09:16Z
author_association: CONTRIBUTOR
diff_hunk: @@ -38,9 +40,9 @@ jobs:
         id: login-ecr
         uses: aws-actions/amazon-ecr-login@v1
 
-      #- name: Perform docker login
-      #  if: github.event.pull_request.draft == false
-      #  run: docker login ghcr.io -u gpsaggese -p ${{ secrets.GITHUB_TOKEN }}
+      - name: Perform docker login
path: .github/workflows/linter.yml
user: login: samarth9008
body: Perform docker login -> Perform GHCR registry login
created_at: 2025-03-14T01:10:26Z
author_association: CONTRIBUTOR
diff_hunk: @@ -38,9 +40,9 @@ jobs:
         id: login-ecr
         uses: aws-actions/amazon-ecr-login@v1
 
-      #- name: Perform docker login
-      #  if: github.event.pull_request.draft == false
-      #  run: docker login ghcr.io -u gpsaggese -p ${{ secrets.GITHUB_TOKEN }}
+      - name: Perform docker login
+        if: github.event.pull_request.draft == false
+        run: docker login ghcr.io -u gpsaggese -p ${{ secrets.GITHUB_TOKEN }}
path: .github/workflows/linter.yml
user: login: samarth9008
body: I would also run the action without performing the login to see if applying permissions is enough.
created_at: 2025-03-14T01:11:27Z
author_association: CONTRIBUTOR
diff_hunk: @@ -71,7 +73,7 @@ jobs:
         if: github.event.pull_request.draft == false
path: .github/workflows/linter.yml
user: login: samarth9008
body: Pull helpers:prod image -> Pull linter image
created_at: 2025-03-14T01:12:27Z
author_association: CONTRIBUTOR
diff_hunk: @@ -71,7 +73,7 @@ jobs:
         if: github.event.pull_request.draft == false
         env:
           CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
path: .github/workflows/linter.yml
user: login: samarth9008
body: I don't think we need this env
created_at: 2025-03-14T01:12:53Z
author_association: CONTRIBUTOR
diff_hunk: @@ -71,7 +73,7 @@ jobs:
         if: github.event.pull_request.draft == false
         env:
           CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
-        run: invoke docker_pull_helpers
+        run: docker pull ghcr.io/causify-ai/helpers:prod
 
       # Run the linter, then check if any file was changed after that. If so,
       # fail the job.
path: .github/workflows/linter.yml
user: login: samarth9008
body: Right image is not fetched due to the code from line 89 to 93. Also `CSFY_ECR_BASE_PATH: ghcr.io/cryptokaizen` -> `CSFY_ECR_BASE_PATH: ghcr.io/causify-ai`

The image that is being used is `causify/helpers:prod`

```
IMAGE=causify/helpers:prod \
        docker compose \
        --file /home/runner/work/helpers/helpers/devops/compose/docker-compose.yml \
        --env-file devops/env/default.env \
        run \
        --rm \
        --name runner.helpers.app.helpers.20250313_1901[42](https://github.com/causify-ai/helpers/actions/runs/13842551128/job/38733328729?pr=374#step:9:43) \
        app \
        $(find -wholename '*linters/base.py') --branch --num_threads -1
```
Right image would be `ghcr.io/causify-ai/helpers:prod`


I would also check if all this env variables are required. if not lets remove them
created_at: 2025-03-14T01:15:20Z
author_association: CONTRIBUTOR
diff_hunk: @@ -38,9 +40,9 @@ jobs:
         id: login-ecr
path: .github/workflows/linter.yml
user: login: dremdem
body: Right. 
Done.
created_at: 2025-03-14T10:53:02Z
author_association: CONTRIBUTOR
diff_hunk: @@ -38,9 +40,9 @@ jobs:
         id: login-ecr
         uses: aws-actions/amazon-ecr-login@v1
 
-      #- name: Perform docker login
-      #  if: github.event.pull_request.draft == false
-      #  run: docker login ghcr.io -u gpsaggese -p ${{ secrets.GITHUB_TOKEN }}
+      - name: Perform docker login
path: .github/workflows/linter.yml
user: login: dremdem
body: Changed.
created_at: 2025-03-14T10:53:29Z
author_association: CONTRIBUTOR
diff_hunk: @@ -38,9 +40,9 @@ jobs:
         id: login-ecr
         uses: aws-actions/amazon-ecr-login@v1
 
-      #- name: Perform docker login
-      #  if: github.event.pull_request.draft == false
-      #  run: docker login ghcr.io -u gpsaggese -p ${{ secrets.GITHUB_TOKEN }}
+      - name: Perform docker login
+        if: github.event.pull_request.draft == false
+        run: docker login ghcr.io -u gpsaggese -p ${{ secrets.GITHUB_TOKEN }}
path: .github/workflows/linter.yml
user: login: dremdem
body: I tried, but got a permission error.
created_at: 2025-03-14T10:54:43Z
author_association: CONTRIBUTOR
diff_hunk: @@ -71,7 +73,7 @@ jobs:
         if: github.event.pull_request.draft == false
path: .github/workflows/linter.yml
user: login: dremdem
body: Changed.
created_at: 2025-03-14T10:55:31Z
author_association: CONTRIBUTOR
diff_hunk: @@ -71,7 +73,7 @@ jobs:
         if: github.event.pull_request.draft == false
         env:
           CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
path: .github/workflows/linter.yml
user: login: dremdem
body: Right, deleted.
created_at: 2025-03-14T10:55:48Z
author_association: CONTRIBUTOR
diff_hunk: @@ -71,7 +73,7 @@ jobs:
         if: github.event.pull_request.draft == false
         env:
           CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
-        run: invoke docker_pull_helpers
+        run: docker pull ghcr.io/causify-ai/helpers:prod
 
       # Run the linter, then check if any file was changed after that. If so,
       # fail the job.
path: .github/workflows/linter.yml
user: login: dremdem
body: > The image that is being used is causify/helpers:prod

I suppose this image was used due these LOCs:
https://github.com/causify-ai/helpers/blob/8e63dc2cc1f95de57a37d8c92e1d6b9dbe3b1705/helpers/lib_tasks_docker.py#L1309-L1312

Seems like we need to:
- address https://github.com/causify-ai/helpers/issues/367
- revert back changes like:
```
    # Infer the docker registry based on the environment.
    if hserver.is_dev_ck():
        base_path = os.environ["CSFY_ECR_BASE_PATH"]
    else:
        base_path = "causify"
```

> I would also check if all this env variables are required. if not lets remove them

I comments them out except the `CSFY_ECR_BASE_PATH`, it works. 
created_at: 2025-03-14T11:10:45Z
author_association: CONTRIBUTOR
diff_hunk: @@ -71,7 +73,7 @@ jobs:
         if: github.event.pull_request.draft == false
         env:
           CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
-        run: invoke docker_pull_helpers
+        run: docker pull ghcr.io/causify-ai/helpers:prod
 
       # Run the linter, then check if any file was changed after that. If so,
       # fail the job.
path: .github/workflows/linter.yml
user: login: samarth9008
body: For now can we just modify the if condition with `if hserver.is_dev_ck() or if hserver.is_inside_ci() :`

#367 is blocked due GP's suggestion.
 
created_at: 2025-03-14T12:51:06Z
author_association: CONTRIBUTOR
diff_hunk: @@ -71,7 +73,7 @@ jobs:
         if: github.event.pull_request.draft == false
         env:
           CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
-        run: invoke docker_pull_helpers
+        run: docker pull ghcr.io/causify-ai/helpers:prod
 
       # Run the linter, then check if any file was changed after that. If so,
       # fail the job.
path: .github/workflows/linter.yml
user: login: dremdem
body: Done.
created_at: 2025-03-14T14:14:31Z
author_association: CONTRIBUTOR
diff_hunk: @@ -80,18 +80,11 @@ jobs:
         # Do not run on draft pull requests.
         if: github.event.pull_request.draft == false
         env:
-          CSFY_AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
-          CSFY_AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
-          CSFY_AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }}
-          CSFY_AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }}
           # Base path for ECR registry.
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
           # If you prefer pulling the image from GHCR, uncomment out the following line and comment the one above.
path: .github/workflows/linter.yml
user: login: samarth9008
body: The right comment would be

```
# If you prefer pulling the image from ECR, comment out the following line and uncomment the one above.
```
created_at: 2025-03-14T15:05:46Z
author_association: CONTRIBUTOR
diff_hunk: @@ -80,18 +80,11 @@ jobs:
         # Do not run on draft pull requests.
         if: github.event.pull_request.draft == false
         env:
-          CSFY_AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
-          CSFY_AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
-          CSFY_AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }}
-          CSFY_AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }}
           # Base path for ECR registry.
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
           # If you prefer pulling the image from GHCR, uncomment out the following line and comment the one above.
           # Base path for GHCR registry.
-          # CSFY_ECR_BASE_PATH: ghcr.io/cryptokaizen
-          CSFY_AWS_S3_BUCKET: ${{ vars.CSFY_AWS_S3_BUCKET }}
-          CSFY_TELEGRAM_TOKEN: ${{ secrets.CSFY_TELEGRAM_TOKEN }}
-          GH_ACTION_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          CSFY_ECR_BASE_PATH: ghcr.io/causify-ai
path: .github/workflows/linter.yml
user: login: samarth9008
body: Lets add a comment above

```
# Although the env name has ECR but the value is set to GHCR registry. This env variable is used inside invokes for fetching the image. We are overriding ECR base path with GHCR base path in order to download image from GHCR.
```
created_at: 2025-03-14T15:08:33Z
author_association: CONTRIBUTOR
diff_hunk: @@ -80,18 +80,11 @@ jobs:
         # Do not run on draft pull requests.
         if: github.event.pull_request.draft == false
         env:
-          CSFY_AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
-          CSFY_AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
-          CSFY_AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }}
-          CSFY_AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }}
           # Base path for ECR registry.
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
           # If you prefer pulling the image from GHCR, uncomment out the following line and comment the one above.
path: .github/workflows/linter.yml
user: login: dremdem
body: Done.
created_at: 2025-03-14T15:25:33Z
author_association: CONTRIBUTOR
diff_hunk: @@ -80,18 +80,11 @@ jobs:
         # Do not run on draft pull requests.
         if: github.event.pull_request.draft == false
         env:
-          CSFY_AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
-          CSFY_AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
-          CSFY_AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }}
-          CSFY_AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }}
           # Base path for ECR registry.
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
           # If you prefer pulling the image from GHCR, uncomment out the following line and comment the one above.
           # Base path for GHCR registry.
-          # CSFY_ECR_BASE_PATH: ghcr.io/cryptokaizen
-          CSFY_AWS_S3_BUCKET: ${{ vars.CSFY_AWS_S3_BUCKET }}
-          CSFY_TELEGRAM_TOKEN: ${{ secrets.CSFY_TELEGRAM_TOKEN }}
-          GH_ACTION_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          CSFY_ECR_BASE_PATH: ghcr.io/causify-ai
path: .github/workflows/linter.yml
user: login: dremdem
body: Added.
created_at: 2025-03-14T15:26:28Z
author_association: CONTRIBUTOR
diff_hunk: @@ -257,3 +257,15 @@
 - This invokes a different service
 - To disable vim go to Settings -> Enable Vim Mode
 - We use the percent format for Jupytext
+
+## Docker Image Tags and Registries matrix
+
+| Image Tag           | AWS ECR | Dockerhub | GHCR |
+| ------------------- | ------- | --------- | ---- |
+| cmamp:dev           | [+]     | [-]       | [-]  |
+| cmamp:prod          | [+]     | [-]       | [-]  |
+| helpers:dev         | [+]     | [+]       | [+]  |
+| helpers:prod        | [+]     | [+]       | [+]  |
+| quant_dashboard:dev | [+]     | [-]       | [-]  |
+| dev_tools:prod      | [+]     | [-]       | [-]  |
+| dev_tools:dev       | [+]     | [-]       | [-]  |
path: docs/work_tools/all.devops_docker.reference.md
user: login: gpsaggese
body: I think this is discontinued
created_at: 2025-03-16T17:27:17Z
author_association: CONTRIBUTOR
diff_hunk: @@ -257,3 +257,15 @@
 - This invokes a different service
 - To disable vim go to Settings -> Enable Vim Mode
 - We use the percent format for Jupytext
+
+## Docker Image Tags and Registries matrix
+
+| Image Tag           | AWS ECR | Dockerhub | GHCR |
path: docs/work_tools/all.devops_docker.reference.md
user: login: gpsaggese
body: Can we add a description of what each image contains and what is used for?
created_at: 2025-03-16T17:27:42Z
author_association: CONTRIBUTOR
diff_hunk: @@ -257,3 +257,15 @@
 - This invokes a different service
 - To disable vim go to Settings -> Enable Vim Mode
 - We use the percent format for Jupytext
+
+## Docker Image Tags and Registries matrix
+
+| Image Tag           | AWS ECR | Dockerhub | GHCR |
+| ------------------- | ------- | --------- | ---- |
+| cmamp:dev           | [+]     | [-]       | [-]  |
path: docs/work_tools/all.devops_docker.reference.md
user: login: gpsaggese
body: Can we explain what it means?
Is it where is updated? Or when we need to push the images?

Let's explain a bit more what and why
created_at: 2025-03-16T17:28:43Z
author_association: CONTRIBUTOR
diff_hunk: @@ -75,33 +78,38 @@ jobs:
           python -m pip install --upgrade pip
           pip install -r .github/gh_requirements.txt
 
-      # Pull the latest Docker image to run the regressions on.
-      - name: Pull image
-        if: github.event.pull_request.draft == false
-        env:
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
-        run: invoke docker_pull
+      # # Pull the latest Docker image to run the regressions on.
+      # - name: Pull image
+      #   if: github.event.pull_request.draft == false
+      #   env:
+      #     CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+      #   run: invoke docker_pull
 
       # Pull the latest Docker image from GHCR registry instead of ECR for cost saving purposes to run the regressions on.
path: .github/workflows/fast_tests.yml
user: login: gpsaggese
body: This comment should cover also the lines 81-86.
created_at: 2025-03-17T20:48:26Z
author_association: CONTRIBUTOR
diff_hunk: @@ -48,8 +50,9 @@ jobs:
         id: login-ecr
         uses: aws-actions/amazon-ecr-login@v1
 
path: .github/workflows/fast_tests.yml
user: login: gpsaggese
body: Are 39-46 still needed then?

Let's try to make it more linear, using comments like

```
# Login to AWS ECR.

# Login to GitHub GHCR.

# Pull image from AWS ECR.

# Pull image from ...
```
created_at: 2025-03-17T20:49:47Z
author_association: CONTRIBUTOR
diff_hunk: @@ -75,33 +78,38 @@ jobs:
           python -m pip install --upgrade pip
           pip install -r .github/gh_requirements.txt
 
-      # Pull the latest Docker image to run the regressions on.
-      - name: Pull image
-        if: github.event.pull_request.draft == false
-        env:
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
-        run: invoke docker_pull
+      # # Pull the latest Docker image to run the regressions on.
+      # - name: Pull image
+      #   if: github.event.pull_request.draft == false
+      #   env:
+      #     CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+      #   run: invoke docker_pull
 
       # Pull the latest Docker image from GHCR registry instead of ECR for cost saving purposes to run the regressions on.
-      #- name: Pull image
-      #  if: github.event.pull_request.draft == false
-      #  run: docker pull ghcr.io/cryptokaizen/cmamp:dev
+      - name: Pull image
+        if: github.event.pull_request.draft == false
+        run: docker pull ghcr.io/causify-ai/helpers:dev
 
+        
       # Run the `invoke` target `run_fast_tests` to run tests that are under 5 seconds.
       # See the corresponding documentation for more information.
       - name: Run fast tests
-        # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/19
-        # Do not run on draft pull requests.
         if: github.event.pull_request.draft == false
+      # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/19
+        # Do not run on draft pull requests.
         env:
           CSFY_AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
           CSFY_AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
           CSFY_AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }}
           CSFY_AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }}
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # Base path for ECR registry.
+          # CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
           # If you prefer pulling the image from ECR, comment out the following line and uncomment the one above.
           # Base path for GHCR registry.
-          #CSFY_ECR_BASE_PATH: ghcr.io/cryptokaizen
+          # Although the env name has ECR but the value is set to GHCR registry.
+          # This env variable is used inside invokes for fetching the image.
+          # We are overriding ECR base path with GHCR base path in order to download image from GHCR.
path: .github/workflows/fast_tests.yml
user: login: gpsaggese
body: The comment has lots of repetition. Let's make it simpler.

created_at: 2025-03-17T20:50:58Z
author_association: CONTRIBUTOR
diff_hunk: @@ -75,33 +78,38 @@ jobs:
           python -m pip install --upgrade pip
           pip install -r .github/gh_requirements.txt
 
-      # Pull the latest Docker image to run the regressions on.
-      - name: Pull image
-        if: github.event.pull_request.draft == false
-        env:
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
-        run: invoke docker_pull
+      # # Pull the latest Docker image to run the regressions on.
+      # - name: Pull image
+      #   if: github.event.pull_request.draft == false
+      #   env:
+      #     CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+      #   run: invoke docker_pull
 
       # Pull the latest Docker image from GHCR registry instead of ECR for cost saving purposes to run the regressions on.
-      #- name: Pull image
-      #  if: github.event.pull_request.draft == false
-      #  run: docker pull ghcr.io/cryptokaizen/cmamp:dev
+      - name: Pull image
+        if: github.event.pull_request.draft == false
+        run: docker pull ghcr.io/causify-ai/helpers:dev
 
+        
       # Run the `invoke` target `run_fast_tests` to run tests that are under 5 seconds.
       # See the corresponding documentation for more information.
       - name: Run fast tests
-        # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/19
-        # Do not run on draft pull requests.
         if: github.event.pull_request.draft == false
+      # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/19
+        # Do not run on draft pull requests.
         env:
           CSFY_AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
           CSFY_AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
           CSFY_AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }}
           CSFY_AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }}
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # Base path for ECR registry.
+          # CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
           # If you prefer pulling the image from ECR, comment out the following line and uncomment the one above.
           # Base path for GHCR registry.
-          #CSFY_ECR_BASE_PATH: ghcr.io/cryptokaizen
+          # Although the env name has ECR but the value is set to GHCR registry.
+          # This env variable is used inside invokes for fetching the image.
+          # We are overriding ECR base path with GHCR base path in order to download image from GHCR.
path: .github/workflows/fast_tests.yml
user: login: dremdem
body: Changed.
created_at: 2025-03-18T12:02:41Z
author_association: CONTRIBUTOR
diff_hunk: @@ -48,8 +50,9 @@ jobs:
         id: login-ecr
         uses: aws-actions/amazon-ecr-login@v1
 
path: .github/workflows/fast_tests.yml
user: login: dremdem
body: > Are 39-46 still needed then?

Yes, I suppose the creds. are using in the tests. 
created_at: 2025-03-18T12:04:54Z
author_association: CONTRIBUTOR
diff_hunk: @@ -48,8 +50,9 @@ jobs:
         id: login-ecr
         uses: aws-actions/amazon-ecr-login@v1
 
path: .github/workflows/fast_tests.yml
user: login: dremdem
body: Done.
created_at: 2025-03-18T15:39:01Z
author_association: CONTRIBUTOR
diff_hunk: @@ -75,33 +78,38 @@ jobs:
           python -m pip install --upgrade pip
           pip install -r .github/gh_requirements.txt
 
-      # Pull the latest Docker image to run the regressions on.
-      - name: Pull image
-        if: github.event.pull_request.draft == false
-        env:
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
-        run: invoke docker_pull
+      # # Pull the latest Docker image to run the regressions on.
+      # - name: Pull image
+      #   if: github.event.pull_request.draft == false
+      #   env:
+      #     CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+      #   run: invoke docker_pull
 
       # Pull the latest Docker image from GHCR registry instead of ECR for cost saving purposes to run the regressions on.
path: .github/workflows/fast_tests.yml
user: login: dremdem
body: Reworked.
created_at: 2025-03-18T16:20:05Z
author_association: CONTRIBUTOR
diff_hunk: @@ -70,38 +73,32 @@ jobs:
 
       # Install packages that are required to run the job via GH.
       - name: Install dependencies
-        if: github.event.pull_request.draft == false
         run: |
           python -m pip install --upgrade pip
           pip install -r .github/gh_requirements.txt
 
-      # Pull the latest Docker image to run the regressions on.
-      - name: Pull image
-        if: github.event.pull_request.draft == false
-        env:
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
-        run: invoke docker_pull
+      # # Pull the latest Docker image from the AWS ECR to run the regressions on.
+      # - name: Pull image from AWS ECR
+      #   env:
+      #     CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+      #   run: invoke docker_pull
 
-      # Pull the latest Docker image from GHCR registry instead of ECR for cost saving purposes to run the regressions on.
-      #- name: Pull image
-      #  if: github.event.pull_request.draft == false
-      #  run: docker pull ghcr.io/cryptokaizen/cmamp:dev
+      # Pull the latest Docker image from the GHCR registry instead of ECR for cost saving purposes to run the regressions on.
+      - name: Pull image from GHCR
+        run: docker pull ghcr.io/${{ github.repository }}:dev
 
       # Run the `invoke` target `run_fast_tests` to run tests that are under 5 seconds.
       # See the corresponding documentation for more information.
       - name: Run fast tests
-        # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/19
-        # Do not run on draft pull requests.
-        if: github.event.pull_request.draft == false
         env:
           CSFY_AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
           CSFY_AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
           CSFY_AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }}
           CSFY_AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }}
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH is the source path for fetching the image.
           # If you prefer pulling the image from ECR, comment out the following line and uncomment the one above.
-          # Base path for GHCR registry.
-          #CSFY_ECR_BASE_PATH: ghcr.io/cryptokaizen
+          CSFY_ECR_BASE_PATH: ghcr.io/causify-ai
path: .github/workflows/fast_tests.yml
user: login: heanhsok
body: 1) should we set it in the repo env var as well? so it's easier to change if we need to.
2) and should it be renamed to `CSFY_GHCR_BASE_PATH` (if it's only for GHCR)?
created_at: 2025-03-19T14:31:00Z
author_association: CONTRIBUTOR
diff_hunk: @@ -70,38 +73,32 @@ jobs:
 
       # Install packages that are required to run the job via GH.
       - name: Install dependencies
-        if: github.event.pull_request.draft == false
         run: |
           python -m pip install --upgrade pip
           pip install -r .github/gh_requirements.txt
 
-      # Pull the latest Docker image to run the regressions on.
-      - name: Pull image
-        if: github.event.pull_request.draft == false
-        env:
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
-        run: invoke docker_pull
+      # # Pull the latest Docker image from the AWS ECR to run the regressions on.
+      # - name: Pull image from AWS ECR
+      #   env:
+      #     CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+      #   run: invoke docker_pull
 
-      # Pull the latest Docker image from GHCR registry instead of ECR for cost saving purposes to run the regressions on.
-      #- name: Pull image
-      #  if: github.event.pull_request.draft == false
-      #  run: docker pull ghcr.io/cryptokaizen/cmamp:dev
+      # Pull the latest Docker image from the GHCR registry instead of ECR for cost saving purposes to run the regressions on.
+      - name: Pull image from GHCR
+        run: docker pull ghcr.io/${{ github.repository }}:dev
 
       # Run the `invoke` target `run_fast_tests` to run tests that are under 5 seconds.
       # See the corresponding documentation for more information.
       - name: Run fast tests
-        # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/19
-        # Do not run on draft pull requests.
-        if: github.event.pull_request.draft == false
         env:
           CSFY_AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
           CSFY_AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
           CSFY_AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }}
           CSFY_AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }}
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH is the source path for fetching the image.
           # If you prefer pulling the image from ECR, comment out the following line and uncomment the one above.
-          # Base path for GHCR registry.
-          #CSFY_ECR_BASE_PATH: ghcr.io/cryptokaizen
+          CSFY_ECR_BASE_PATH: ghcr.io/causify-ai
path: .github/workflows/fast_tests.yml
user: login: dremdem
body: > should we set it in the repo env var as well? so it's easier to change if we need to.

I'm even inclined to use `github.repository_owner` like described [in the docs:](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs) 

So this line can looks like: 

```
CSFY_ECR_BASE_PATH: ghcr.io/${{ github.repository_owner` }}
```

> and should it be renamed to CSFY_GHCR_BASE_PATH (if it's only for GHCR)?

I'm confusing, since it can switched in between `AWS ECR` and `GHCR`.

@samarth9008 FYI
created_at: 2025-03-19T14:45:03Z
author_association: CONTRIBUTOR
diff_hunk: @@ -70,38 +73,32 @@ jobs:
 
       # Install packages that are required to run the job via GH.
       - name: Install dependencies
-        if: github.event.pull_request.draft == false
         run: |
           python -m pip install --upgrade pip
           pip install -r .github/gh_requirements.txt
 
-      # Pull the latest Docker image to run the regressions on.
-      - name: Pull image
-        if: github.event.pull_request.draft == false
-        env:
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
-        run: invoke docker_pull
+      # # Pull the latest Docker image from the AWS ECR to run the regressions on.
+      # - name: Pull image from AWS ECR
+      #   env:
+      #     CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+      #   run: invoke docker_pull
 
-      # Pull the latest Docker image from GHCR registry instead of ECR for cost saving purposes to run the regressions on.
-      #- name: Pull image
-      #  if: github.event.pull_request.draft == false
-      #  run: docker pull ghcr.io/cryptokaizen/cmamp:dev
+      # Pull the latest Docker image from the GHCR registry instead of ECR for cost saving purposes to run the regressions on.
+      - name: Pull image from GHCR
+        run: docker pull ghcr.io/${{ github.repository }}:dev
 
       # Run the `invoke` target `run_fast_tests` to run tests that are under 5 seconds.
       # See the corresponding documentation for more information.
       - name: Run fast tests
-        # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/19
-        # Do not run on draft pull requests.
-        if: github.event.pull_request.draft == false
         env:
           CSFY_AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
           CSFY_AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
           CSFY_AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }}
           CSFY_AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }}
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH is the source path for fetching the image.
           # If you prefer pulling the image from ECR, comment out the following line and uncomment the one above.
-          # Base path for GHCR registry.
-          #CSFY_ECR_BASE_PATH: ghcr.io/cryptokaizen
+          CSFY_ECR_BASE_PATH: ghcr.io/causify-ai
path: .github/workflows/fast_tests.yml
user: login: heanhsok
body: > I'm confusing, since it can switched in between AWS ECR and GHCR.

Yes it can be confusing because the name is ECR. so for better clarity, should we make it more generic such as `CSFY_CR_BASE_PATH` (CR - Container Registry) and be able to switch between different registries, or use different variables (`CSFY_ECR_BASE_PATH`, `CSFY_GHCR_BASE_PATH`,..etc) for each registry? WDYT?
created_at: 2025-03-19T14:58:06Z
author_association: CONTRIBUTOR
diff_hunk: @@ -70,38 +73,32 @@ jobs:
 
       # Install packages that are required to run the job via GH.
       - name: Install dependencies
-        if: github.event.pull_request.draft == false
         run: |
           python -m pip install --upgrade pip
           pip install -r .github/gh_requirements.txt
 
-      # Pull the latest Docker image to run the regressions on.
-      - name: Pull image
-        if: github.event.pull_request.draft == false
-        env:
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
-        run: invoke docker_pull
+      # # Pull the latest Docker image from the AWS ECR to run the regressions on.
+      # - name: Pull image from AWS ECR
+      #   env:
+      #     CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+      #   run: invoke docker_pull
 
-      # Pull the latest Docker image from GHCR registry instead of ECR for cost saving purposes to run the regressions on.
-      #- name: Pull image
-      #  if: github.event.pull_request.draft == false
-      #  run: docker pull ghcr.io/cryptokaizen/cmamp:dev
+      # Pull the latest Docker image from the GHCR registry instead of ECR for cost saving purposes to run the regressions on.
+      - name: Pull image from GHCR
+        run: docker pull ghcr.io/${{ github.repository }}:dev
 
       # Run the `invoke` target `run_fast_tests` to run tests that are under 5 seconds.
       # See the corresponding documentation for more information.
       - name: Run fast tests
-        # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/19
-        # Do not run on draft pull requests.
-        if: github.event.pull_request.draft == false
         env:
           CSFY_AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
           CSFY_AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
           CSFY_AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }}
           CSFY_AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }}
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH is the source path for fetching the image.
           # If you prefer pulling the image from ECR, comment out the following line and uncomment the one above.
-          # Base path for GHCR registry.
-          #CSFY_ECR_BASE_PATH: ghcr.io/cryptokaizen
+          CSFY_ECR_BASE_PATH: ghcr.io/causify-ai
path: .github/workflows/fast_tests.yml
user: login: dremdem
body: Yes, renaming sounds reasonable, but this variable is used in many places throughout the code, and the changes would be quite extensive. I'm not sure we need to do it in this PR.

created_at: 2025-03-19T15:30:46Z
author_association: CONTRIBUTOR
diff_hunk: @@ -70,38 +73,32 @@ jobs:
 
       # Install packages that are required to run the job via GH.
       - name: Install dependencies
-        if: github.event.pull_request.draft == false
         run: |
           python -m pip install --upgrade pip
           pip install -r .github/gh_requirements.txt
 
-      # Pull the latest Docker image to run the regressions on.
-      - name: Pull image
-        if: github.event.pull_request.draft == false
-        env:
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
-        run: invoke docker_pull
+      # # Pull the latest Docker image from the AWS ECR to run the regressions on.
+      # - name: Pull image from AWS ECR
+      #   env:
+      #     CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+      #   run: invoke docker_pull
 
-      # Pull the latest Docker image from GHCR registry instead of ECR for cost saving purposes to run the regressions on.
-      #- name: Pull image
-      #  if: github.event.pull_request.draft == false
-      #  run: docker pull ghcr.io/cryptokaizen/cmamp:dev
+      # Pull the latest Docker image from the GHCR registry instead of ECR for cost saving purposes to run the regressions on.
+      - name: Pull image from GHCR
+        run: docker pull ghcr.io/${{ github.repository }}:dev
 
       # Run the `invoke` target `run_fast_tests` to run tests that are under 5 seconds.
       # See the corresponding documentation for more information.
       - name: Run fast tests
-        # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/19
-        # Do not run on draft pull requests.
-        if: github.event.pull_request.draft == false
         env:
           CSFY_AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
           CSFY_AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
           CSFY_AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }}
           CSFY_AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }}
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH is the source path for fetching the image.
           # If you prefer pulling the image from ECR, comment out the following line and uncomment the one above.
-          # Base path for GHCR registry.
-          #CSFY_ECR_BASE_PATH: ghcr.io/cryptokaizen
+          CSFY_ECR_BASE_PATH: ghcr.io/causify-ai
path: .github/workflows/fast_tests.yml
user: login: samarth9008
body: That is the case. Its better to file a TODO and see what changes we need in the code.
created_at: 2025-03-19T15:40:55Z
author_association: CONTRIBUTOR
diff_hunk: @@ -70,38 +73,32 @@ jobs:
 
       # Install packages that are required to run the job via GH.
       - name: Install dependencies
-        if: github.event.pull_request.draft == false
         run: |
           python -m pip install --upgrade pip
           pip install -r .github/gh_requirements.txt
 
-      # Pull the latest Docker image to run the regressions on.
-      - name: Pull image
-        if: github.event.pull_request.draft == false
-        env:
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
-        run: invoke docker_pull
+      # # Pull the latest Docker image from the AWS ECR to run the regressions on.
+      # - name: Pull image from AWS ECR
+      #   env:
+      #     CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+      #   run: invoke docker_pull
 
-      # Pull the latest Docker image from GHCR registry instead of ECR for cost saving purposes to run the regressions on.
-      #- name: Pull image
-      #  if: github.event.pull_request.draft == false
-      #  run: docker pull ghcr.io/cryptokaizen/cmamp:dev
+      # Pull the latest Docker image from the GHCR registry instead of ECR for cost saving purposes to run the regressions on.
+      - name: Pull image from GHCR
+        run: docker pull ghcr.io/${{ github.repository }}:dev
 
       # Run the `invoke` target `run_fast_tests` to run tests that are under 5 seconds.
       # See the corresponding documentation for more information.
       - name: Run fast tests
-        # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/19
-        # Do not run on draft pull requests.
-        if: github.event.pull_request.draft == false
         env:
           CSFY_AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
           CSFY_AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
           CSFY_AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }}
           CSFY_AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }}
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH is the source path for fetching the image.
           # If you prefer pulling the image from ECR, comment out the following line and uncomment the one above.
-          # Base path for GHCR registry.
-          #CSFY_ECR_BASE_PATH: ghcr.io/cryptokaizen
+          CSFY_ECR_BASE_PATH: ghcr.io/causify-ai
path: .github/workflows/fast_tests.yml
user: login: heanhsok
body: Yes agree. renaming can be done is a follow up.
created_at: 2025-03-19T15:41:57Z
author_association: CONTRIBUTOR
diff_hunk: @@ -70,38 +73,32 @@ jobs:
 
       # Install packages that are required to run the job via GH.
       - name: Install dependencies
-        if: github.event.pull_request.draft == false
         run: |
           python -m pip install --upgrade pip
           pip install -r .github/gh_requirements.txt
 
-      # Pull the latest Docker image to run the regressions on.
-      - name: Pull image
-        if: github.event.pull_request.draft == false
-        env:
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
-        run: invoke docker_pull
+      # # Pull the latest Docker image from the AWS ECR to run the regressions on.
+      # - name: Pull image from AWS ECR
+      #   env:
+      #     CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+      #   run: invoke docker_pull
 
-      # Pull the latest Docker image from GHCR registry instead of ECR for cost saving purposes to run the regressions on.
-      #- name: Pull image
-      #  if: github.event.pull_request.draft == false
-      #  run: docker pull ghcr.io/cryptokaizen/cmamp:dev
+      # Pull the latest Docker image from the GHCR registry instead of ECR for cost saving purposes to run the regressions on.
+      - name: Pull image from GHCR
+        run: docker pull ghcr.io/${{ github.repository }}:dev
 
       # Run the `invoke` target `run_fast_tests` to run tests that are under 5 seconds.
       # See the corresponding documentation for more information.
       - name: Run fast tests
-        # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/19
-        # Do not run on draft pull requests.
-        if: github.event.pull_request.draft == false
         env:
           CSFY_AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
           CSFY_AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
           CSFY_AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }}
           CSFY_AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }}
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH is the source path for fetching the image.
           # If you prefer pulling the image from ECR, comment out the following line and uncomment the one above.
-          # Base path for GHCR registry.
-          #CSFY_ECR_BASE_PATH: ghcr.io/cryptokaizen
+          CSFY_ECR_BASE_PATH: ghcr.io/causify-ai
path: .github/workflows/fast_tests.yml
user: login: dremdem
body: Added a TODO. 
created_at: 2025-03-19T15:53:51Z
author_association: CONTRIBUTOR
diff_hunk: @@ -27,29 +27,32 @@ permissions:
   id-token: write
   # This is required for actions/checkout.
   contents: read
+  # This is required for pulling the Docker image from GHCR.
+  packages: read
 jobs:
   run_fast_tests:
+    # Do not run on draft pull requests or when the workflow is triggered manually.
+    if: ${{ github.event.pull_request.draft == false || github.event_name == 'workflow_dispatch' }}
path: .github/workflows/fast_tests.yml
user: login: samarth9008
body: Why should we not run it when workflow is triggered manually?
created_at: 2025-03-19T16:11:06Z
author_association: CONTRIBUTOR
diff_hunk: @@ -70,38 +73,33 @@ jobs:
 
       # Install packages that are required to run the job via GH.
       - name: Install dependencies
-        if: github.event.pull_request.draft == false
         run: |
           python -m pip install --upgrade pip
           pip install -r .github/gh_requirements.txt
 
-      # Pull the latest Docker image to run the regressions on.
-      - name: Pull image
-        if: github.event.pull_request.draft == false
-        env:
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
-        run: invoke docker_pull
+      # # Pull the latest Docker image from the AWS ECR to run the regressions on.
+      # - name: Pull image from AWS ECR
+      #   env:
+      #     CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+      #   run: invoke docker_pull
 
-      # Pull the latest Docker image from GHCR registry instead of ECR for cost saving purposes to run the regressions on.
-      #- name: Pull image
-      #  if: github.event.pull_request.draft == false
-      #  run: docker pull ghcr.io/cryptokaizen/cmamp:dev
+      # Pull the latest Docker image from the GHCR registry instead of ECR for cost saving purposes to run the regressions on.
+      - name: Pull image from GHCR
+        run: docker pull ghcr.io/${{ github.repository }}:dev
 
       # Run the `invoke` target `run_fast_tests` to run tests that are under 5 seconds.
       # See the corresponding documentation for more information.
       - name: Run fast tests
-        # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/19
-        # Do not run on draft pull requests.
-        if: github.event.pull_request.draft == false
         env:
           CSFY_AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
           CSFY_AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
           CSFY_AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }}
           CSFY_AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }}
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH is the source path for fetching the image.
           # If you prefer pulling the image from ECR, comment out the following line and uncomment the one above.
-          # Base path for GHCR registry.
-          #CSFY_ECR_BASE_PATH: ghcr.io/cryptokaizen
+          # TODO(Vlad): Rename the variable to CSFY_CR_BASE_PATH since it can be either GHCR or ECR.
+          CSFY_ECR_BASE_PATH: ghcr.io/${{ github.repository_owner }}
           CSFY_AWS_S3_BUCKET: ${{ vars.CSFY_AWS_S3_BUCKET }}
           CSFY_TELEGRAM_TOKEN: ${{ secrets.CSFY_TELEGRAM_TOKEN }}
path: .github/workflows/fast_tests.yml
user: login: samarth9008
body: We don't need TG Token anymore. Lets remove it
created_at: 2025-03-19T16:17:18Z
author_association: CONTRIBUTOR
diff_hunk: @@ -15,42 +15,43 @@ permissions:
   id-token: write
   # This is required for actions/checkout.
   contents: read
+  # This is required for pulling the Docker image from GHCR.
+  packages: read
 
 jobs:
 
   Run_linter:
+    # Do not run on draft pull requests or when the workflow is triggered manually.
+    if: ${{ github.event.pull_request.draft == false || github.event_name == 'workflow_dispatch' }}
path: .github/workflows/linter.yml
user: login: samarth9008
body: Same question
created_at: 2025-03-19T16:19:56Z
author_association: CONTRIBUTOR
diff_hunk: @@ -30,14 +30,16 @@ permissions:
   id-token: write
   # This is required for actions/checkout.
   contents: read
+  # This is required for pulling the Docker image from GHCR.
+  packages: read
 
 jobs:
   run_slow_tests:
+    # Do not run on draft pull requests or when the workflow is triggered manually.
+    if: ${{ github.event.pull_request.draft == false || github.event_name == 'workflow_dispatch' }}
     runs-on: ubuntu-latest
 
     steps:
-      # To optimize costs, the image is fetched from GHCR registry by default. If you prefer
-      # pulling the image from ECR, enable this.
       # Pass AWS credentials via GH secrets. This is needed to pull the Docker image
       # that will be used to run the action.
path: .github/workflows/slow_tests.yml
user: login: samarth9008
body: Make the comment same as fast tests
created_at: 2025-03-19T16:27:45Z
author_association: CONTRIBUTOR
diff_hunk: @@ -74,22 +78,19 @@ jobs:
 
       # Install packages that are required to run the job via GH.
       - name: Install dependencies
-        if: github.event.pull_request.draft == false
         run: |
           python -m pip install --upgrade pip
           pip install -r .github/gh_requirements.txt
 
-      # Pull the latest Docker image to run the regressions on.
-      - name: Pull image
-        if: github.event.pull_request.draft == false
-        env:
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
-        run: invoke docker_pull
+      # # Pull the latest Docker image from the AWS ECR to run the regressions on.
+      # - name: Pull image from AWS ECR
+      #   env:
+      #     CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+      #   run: invoke docker_pull
 
-      # Pull the latest Docker image from GHCR registry instead of ECR for cost saving purposes to run the regressions on.
-      #- name: Pull image
-      #  if: github.event.pull_request.draft == false
-      #  run: docker pull ghcr.io/cryptokaizen/cmamp:dev
+      # Pull the latest Docker image from the GHCR registry instead of ECR for cost saving purposes to run the regressions on.
path: .github/workflows/slow_tests.yml
user: login: samarth9008
body: 80 chars per line. Check other workflows
created_at: 2025-03-19T16:28:58Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1308,7 +1308,11 @@ def _get_lint_docker_cmd(
     :param stage: the image stage to use
     :return: the full command to run
     """
-    base_path = os.environ["CSFY_ECR_BASE_PATH"]
+    # Infer the docker registry based on the environment.
+    if hserver.is_dev_ck() or hserver.is_inside_ci():
+        base_path = os.environ["CSFY_ECR_BASE_PATH"]
+    else:
+        base_path = "causify"
path: helpers/lib_tasks_docker.py
user: login: samarth9008
body: I think we can revert this change due to the merging of this PR - https://github.com/causify-ai/helpers/commit/6c528c1554844daf1672ecafabb1821757d3b0f8

created_at: 2025-03-19T16:37:34Z
author_association: CONTRIBUTOR
diff_hunk: @@ -27,29 +27,32 @@ permissions:
   id-token: write
   # This is required for actions/checkout.
   contents: read
+  # This is required for pulling the Docker image from GHCR.
+  packages: read
 jobs:
   run_fast_tests:
+    # Do not run on draft pull requests or when the workflow is triggered manually.
+    if: ${{ github.event.pull_request.draft == false || github.event_name == 'workflow_dispatch' }}
path: .github/workflows/fast_tests.yml
user: login: dremdem
body: Oops, this is the right code but wrong comment. 

Changed to: 
```
    # Execute this step only if the pull request is not in the draft state or if
    # the workflow is triggered manually.
```
created_at: 2025-03-19T17:02:59Z
author_association: CONTRIBUTOR
diff_hunk: @@ -70,38 +73,33 @@ jobs:
 
       # Install packages that are required to run the job via GH.
       - name: Install dependencies
-        if: github.event.pull_request.draft == false
         run: |
           python -m pip install --upgrade pip
           pip install -r .github/gh_requirements.txt
 
-      # Pull the latest Docker image to run the regressions on.
-      - name: Pull image
-        if: github.event.pull_request.draft == false
-        env:
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
-        run: invoke docker_pull
+      # # Pull the latest Docker image from the AWS ECR to run the regressions on.
+      # - name: Pull image from AWS ECR
+      #   env:
+      #     CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+      #   run: invoke docker_pull
 
-      # Pull the latest Docker image from GHCR registry instead of ECR for cost saving purposes to run the regressions on.
-      #- name: Pull image
-      #  if: github.event.pull_request.draft == false
-      #  run: docker pull ghcr.io/cryptokaizen/cmamp:dev
+      # Pull the latest Docker image from the GHCR registry instead of ECR for cost saving purposes to run the regressions on.
+      - name: Pull image from GHCR
+        run: docker pull ghcr.io/${{ github.repository }}:dev
 
       # Run the `invoke` target `run_fast_tests` to run tests that are under 5 seconds.
       # See the corresponding documentation for more information.
       - name: Run fast tests
-        # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/19
-        # Do not run on draft pull requests.
-        if: github.event.pull_request.draft == false
         env:
           CSFY_AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
           CSFY_AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
           CSFY_AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }}
           CSFY_AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }}
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+          # CSFY_ECR_BASE_PATH is the source path for fetching the image.
           # If you prefer pulling the image from ECR, comment out the following line and uncomment the one above.
-          # Base path for GHCR registry.
-          #CSFY_ECR_BASE_PATH: ghcr.io/cryptokaizen
+          # TODO(Vlad): Rename the variable to CSFY_CR_BASE_PATH since it can be either GHCR or ECR.
+          CSFY_ECR_BASE_PATH: ghcr.io/${{ github.repository_owner }}
           CSFY_AWS_S3_BUCKET: ${{ vars.CSFY_AWS_S3_BUCKET }}
           CSFY_TELEGRAM_TOKEN: ${{ secrets.CSFY_TELEGRAM_TOKEN }}
path: .github/workflows/fast_tests.yml
user: login: dremdem
body: Done.
created_at: 2025-03-19T17:05:49Z
author_association: CONTRIBUTOR
diff_hunk: @@ -15,42 +15,43 @@ permissions:
   id-token: write
   # This is required for actions/checkout.
   contents: read
+  # This is required for pulling the Docker image from GHCR.
+  packages: read
 
 jobs:
 
   Run_linter:
+    # Do not run on draft pull requests or when the workflow is triggered manually.
+    if: ${{ github.event.pull_request.draft == false || github.event_name == 'workflow_dispatch' }}
path: .github/workflows/linter.yml
user: login: dremdem
body: Answered here: 
https://github.com/causify-ai/helpers/pull/374#discussion_r2003840294
created_at: 2025-03-19T17:06:12Z
author_association: CONTRIBUTOR
diff_hunk: @@ -30,14 +30,16 @@ permissions:
   id-token: write
   # This is required for actions/checkout.
   contents: read
+  # This is required for pulling the Docker image from GHCR.
+  packages: read
 
 jobs:
   run_slow_tests:
+    # Do not run on draft pull requests or when the workflow is triggered manually.
+    if: ${{ github.event.pull_request.draft == false || github.event_name == 'workflow_dispatch' }}
     runs-on: ubuntu-latest
 
     steps:
-      # To optimize costs, the image is fetched from GHCR registry by default. If you prefer
-      # pulling the image from ECR, enable this.
       # Pass AWS credentials via GH secrets. This is needed to pull the Docker image
       # that will be used to run the action.
path: .github/workflows/slow_tests.yml
user: login: dremdem
body: Done.
created_at: 2025-03-19T17:07:27Z
author_association: CONTRIBUTOR
diff_hunk: @@ -74,22 +78,19 @@ jobs:
 
       # Install packages that are required to run the job via GH.
       - name: Install dependencies
-        if: github.event.pull_request.draft == false
         run: |
           python -m pip install --upgrade pip
           pip install -r .github/gh_requirements.txt
 
-      # Pull the latest Docker image to run the regressions on.
-      - name: Pull image
-        if: github.event.pull_request.draft == false
-        env:
-          CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
-        run: invoke docker_pull
+      # # Pull the latest Docker image from the AWS ECR to run the regressions on.
+      # - name: Pull image from AWS ECR
+      #   env:
+      #     CSFY_ECR_BASE_PATH: ${{ vars.CSFY_ECR_BASE_PATH }}
+      #   run: invoke docker_pull
 
-      # Pull the latest Docker image from GHCR registry instead of ECR for cost saving purposes to run the regressions on.
-      #- name: Pull image
-      #  if: github.event.pull_request.draft == false
-      #  run: docker pull ghcr.io/cryptokaizen/cmamp:dev
+      # Pull the latest Docker image from the GHCR registry instead of ECR for cost saving purposes to run the regressions on.
path: .github/workflows/slow_tests.yml
user: login: dremdem
body: Done.
created_at: 2025-03-19T17:14:31Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1308,7 +1308,11 @@ def _get_lint_docker_cmd(
     :param stage: the image stage to use
     :return: the full command to run
     """
-    base_path = os.environ["CSFY_ECR_BASE_PATH"]
+    # Infer the docker registry based on the environment.
+    if hserver.is_dev_ck() or hserver.is_inside_ci():
+        base_path = os.environ["CSFY_ECR_BASE_PATH"]
+    else:
+        base_path = "causify"
path: helpers/lib_tasks_docker.py
user: login: dremdem
body: Done.
created_at: 2025-03-19T17:18:32Z
author_association: CONTRIBUTOR
diff_hunk: @@ -27,29 +27,33 @@ permissions:
   id-token: write
   # This is required for actions/checkout.
   contents: read
+  # This is required for pulling the Docker image from GHCR.
+  packages: read
 jobs:
   run_fast_tests:
+    # Execute this step only if the pull request is not in the draft state or if
+    # the workflow is triggered manually.
+    if: ${{ github.event.pull_request.draft == false || github.event_name == 'workflow_dispatch' }}
path: .github/workflows/fast_tests.yml
user: login: samarth9008
body: Do we need this condition in the first place? `github.event_name == 'workflow_dispatch'`

On the top inside `on:` we already define `workflow_dispatch:` so it is anyway going to run on manually trigger

created_at: 2025-03-19T17:57:46Z
author_association: CONTRIBUTOR
diff_hunk: @@ -27,29 +27,33 @@ permissions:
   id-token: write
   # This is required for actions/checkout.
   contents: read
+  # This is required for pulling the Docker image from GHCR.
+  packages: read
 jobs:
   run_fast_tests:
+    # Execute this step only if the pull request is not in the draft state or if
+    # the workflow is triggered manually.
+    if: ${{ github.event.pull_request.draft == false || github.event_name == 'workflow_dispatch' }}
path: .github/workflows/fast_tests.yml
user: login: dremdem
body: Checked. Yes, if we delete the `github.event_name == 'workflow_dispatch'` from the if condition,
then it works too.
For me, it's not obvious why, when I run the tests manually for a pull request in the `draft` state, it still runs. Perhaps it's because the context `github.event.pull_request` is not accessible in this case since I ran it manually. 

But for the readers, it's not so straightforward:
- We have a PR in a `draft` state.
- We run the GH action manually against this branch.
- We have the `github.event.pull_request.draft == false` condition on top of this GH action, but the GH action still runs.

created_at: 2025-03-20T12:10:46Z
author_association: CONTRIBUTOR
diff_hunk: @@ -27,29 +27,33 @@ permissions:
   id-token: write
   # This is required for actions/checkout.
   contents: read
+  # This is required for pulling the Docker image from GHCR.
+  packages: read
 jobs:
   run_fast_tests:
+    # Execute this step only if the pull request is not in the draft state or if
+    # the workflow is triggered manually.
+    if: ${{ github.event.pull_request.draft == false || github.event_name == 'workflow_dispatch' }}
path: .github/workflows/fast_tests.yml
user: login: dremdem
body: BTW found the issue when run GH actions manually, even on the master branch: 
<img width="1313" alt="image" src="https://github.com/user-attachments/assets/3cab02f9-2064-4203-b0f6-2cf132a13a5e" />

https://github.com/causify-ai/helpers/actions/runs/13969291039/job/39106881728

@samarth9008 
Should I file an issue? 
created_at: 2025-03-20T12:34:03Z
author_association: CONTRIBUTOR
diff_hunk: @@ -27,29 +27,33 @@ permissions:
   id-token: write
   # This is required for actions/checkout.
   contents: read
+  # This is required for pulling the Docker image from GHCR.
+  packages: read
 jobs:
   run_fast_tests:
+    # Execute this step only if the pull request is not in the draft state or if
+    # the workflow is triggered manually.
+    if: ${{ github.event.pull_request.draft == false || github.event_name == 'workflow_dispatch' }}
path: .github/workflows/fast_tests.yml
user: login: samarth9008
body: Sure
created_at: 2025-03-20T15:42:49Z
author_association: CONTRIBUTOR
diff_hunk: @@ -27,29 +27,33 @@ permissions:
   id-token: write
   # This is required for actions/checkout.
   contents: read
+  # This is required for pulling the Docker image from GHCR.
+  packages: read
 jobs:
   run_fast_tests:
+    # Execute this step only if the pull request is not in the draft state or if
+    # the workflow is triggered manually.
+    if: ${{ github.event.pull_request.draft == false || github.event_name == 'workflow_dispatch' }}
path: .github/workflows/fast_tests.yml
user: login: dremdem
body: @samarth9008 
Can you pls answer on this comment: 
https://github.com/causify-ai/helpers/pull/374#discussion_r2005496645
created_at: 2025-03-20T15:51:41Z
author_association: CONTRIBUTOR
diff_hunk: @@ -27,29 +27,33 @@ permissions:
   id-token: write
   # This is required for actions/checkout.
   contents: read
+  # This is required for pulling the Docker image from GHCR.
+  packages: read
 jobs:
   run_fast_tests:
+    # Execute this step only if the pull request is not in the draft state or if
+    # the workflow is triggered manually.
+    if: ${{ github.event.pull_request.draft == false || github.event_name == 'workflow_dispatch' }}
path: .github/workflows/fast_tests.yml
user: login: dremdem
body: > Sure

Filed: 
https://github.com/causify-ai/cmamp/issues/11656
created_at: 2025-03-20T16:03:34Z
author_association: CONTRIBUTOR
diff_hunk: @@ -27,29 +27,33 @@ permissions:
   id-token: write
   # This is required for actions/checkout.
   contents: read
+  # This is required for pulling the Docker image from GHCR.
+  packages: read
 jobs:
   run_fast_tests:
+    # Execute this step only if the pull request is not in the draft state or if
+    # the workflow is triggered manually.
+    if: ${{ github.event.pull_request.draft == false || github.event_name == 'workflow_dispatch' }}
path: .github/workflows/fast_tests.yml
user: login: samarth9008
body: > * We have the `github.event.pull_request.draft == false` condition on top of this GH action, but the GH action still runs.

Can you do some google search to answer this question?
created_at: 2025-03-20T16:50:12Z
author_association: CONTRIBUTOR
diff_hunk: @@ -27,29 +27,33 @@ permissions:
   id-token: write
   # This is required for actions/checkout.
   contents: read
+  # This is required for pulling the Docker image from GHCR.
+  packages: read
 jobs:
   run_fast_tests:
+    # Execute this step only if the pull request is not in the draft state or if
+    # the workflow is triggered manually.
+    if: ${{ github.event.pull_request.draft == false || github.event_name == 'workflow_dispatch' }}
path: .github/workflows/fast_tests.yml
user: login: dremdem
body: Summary: 

This is an accident that the `github.event.pull_request.draft == false` is the `true`, when we run the the GH workflow, because:

> If you attempt to dereference a nonexistent property, it will evaluate to an empty string.

Docs: 
https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#about-contexts

## TLDR; 

### ChatGPT: 

> When you manually trigger a GitHub Actions workflow using the workflow_dispatch event, the github.event.pull_request context may not be populated as it would be during an automatic pull request event. This is because the workflow_dispatch event does not inherently carry information about pull requests. As a result, conditionals like if: ${{ github.event.pull_request.draft == false }} may not function as expected, potentially causing the step to execute regardless of the pull request's draft status.

### My experiments: 

I have added: 

```
      - name: test if evaluation
        run: |
          echo "if: ${{ github.event.pull_request.draft == false }}"
          echo "draft: ${{ github.event.pull_request.draft }}"
```

and commented out the `if` condition.

#### Results: 

For the run from the pushing in the PR: 
https://github.com/causify-ai/helpers/actions/runs/13976539274/job/39131638938?pr=374

```
if: false
draft: true
```

Run manually:
https://github.com/causify-ai/helpers/actions/runs/13976575795/job/39131757911
```
if: true
draft: 
```

So, because of 

> If you attempt to dereference a nonexistent property, it will evaluate to an empty string.

When we run the GH workflow manually, the `github.event.pull_request.draft` is evaluating as "".
And `${{ github.event.pull_request.draft == false }}` -> `${{ "" == false }}` -> `true`.
So, the `if` condition "works", but not as expected.

created_at: 2025-03-20T18:49:21Z
author_association: CONTRIBUTOR
diff_hunk: @@ -27,29 +27,33 @@ permissions:
   id-token: write
   # This is required for actions/checkout.
   contents: read
+  # This is required for pulling the Docker image from GHCR.
+  packages: read
 jobs:
   run_fast_tests:
+    # Execute this step only if the pull request is not in the draft state or if
+    # the workflow is triggered manually.
+    if: ${{ github.event.pull_request.draft == false || github.event_name == 'workflow_dispatch' }}
path: .github/workflows/fast_tests.yml
user: login: dremdem
body: Applied solution as discussed.
created_at: 2025-03-24T15:57:59Z
author_association: CONTRIBUTOR
diff_hunk: @@ -30,30 +30,36 @@ permissions:
   id-token: write
   # This is required for actions/checkout.
   contents: read
+  # This is required for pulling the Docker image from GHCR.
+  packages: read
 
 jobs:
   run_slow_tests:
+    # We expect user to not execute manual run in a draft PR.
+    # The reason is `github.event.pull_request.draft` is evaluated as empty
+    # string and the condition is always true which is not the right state.
+    if: ${{ github.event.pull_request.draft == false }}
     runs-on: ubuntu-latest
 
     steps:
-      # To optimize costs, the image is fetched from GHCR registry by default. If you prefer
-      # pulling the image from ECR, enable this.
-      # Pass AWS credentials via GH secrets. This is needed to pull the Docker image
-      # that will be used to run the action.
+      # Pass AWS credentials via GH secrets. This is needed to pull the Docker
+      # image and in case the tests need to access AWS resources.
path: .github/workflows/slow_tests.yml
user: login: samarth9008
body: This comment should be added to fast tests as well
created_at: 2025-03-24T19:53:04Z
author_association: CONTRIBUTOR
diff_hunk: @@ -30,30 +30,36 @@ permissions:
   id-token: write
   # This is required for actions/checkout.
   contents: read
+  # This is required for pulling the Docker image from GHCR.
+  packages: read
 
 jobs:
   run_slow_tests:
+    # We expect user to not execute manual run in a draft PR.
+    # The reason is `github.event.pull_request.draft` is evaluated as empty
+    # string and the condition is always true which is not the right state.
+    if: ${{ github.event.pull_request.draft == false }}
     runs-on: ubuntu-latest
 
     steps:
-      # To optimize costs, the image is fetched from GHCR registry by default. If you prefer
-      # pulling the image from ECR, enable this.
-      # Pass AWS credentials via GH secrets. This is needed to pull the Docker image
-      # that will be used to run the action.
+      # Pass AWS credentials via GH secrets. This is needed to pull the Docker
+      # image and in case the tests need to access AWS resources.
path: .github/workflows/slow_tests.yml
user: login: dremdem
body: Done.
created_at: 2025-03-25T12:39:28Z
author_association: CONTRIBUTOR

PR comments:
user: login: dremdem
created_at: 2025-03-13T19:46:51Z
body: @samarth9008 
Can you review the `linter` workflow? 
If it's ok, then I'll apply this solution to all others workflows.
author_association: CONTRIBUTOR
user: login: gpsaggese
created_at: 2025-03-16T17:31:55Z
body: @heanhsok can you pls be in the loop too?
author_association: CONTRIBUTOR
user: login: gpsaggese
created_at: 2025-03-16T17:35:13Z
body: Also can we start using the link approach so we can maintain a single file?
@heanhsok wrote a tool to handle these problems
author_association: CONTRIBUTOR
user: login: samarth9008
created_at: 2025-03-16T19:17:33Z
body: > Also can we start using the link approach so we can maintain a single file? @heanhsok wrote a tool to handle these problems

@heanhsok feel free to guide us on this

author_association: CONTRIBUTOR
user: login: heanhsok
created_at: 2025-03-17T21:21:19Z
body: > Also can we start using the link approach so we can maintain a single file?

Unfortunately we cannot use symlinks for workflow files as explained in https://github.com/causify-ai/csfy/issues/5528.

As an alternative, we can explore the [reusable workflows](https://resources.github.com/learn/pathways/automation/intermediate/create-reusable-workflows-in-github-actions/) approach as done in https://github.com/causify-ai/template/pull/2/files
author_association: CONTRIBUTOR
user: login: dremdem
created_at: 2025-03-18T15:38:39Z
body: @samarth9008, side question:
Do we need the `superslow` GH action in the `helpers` repo since there are no `superslow` tests at all?
<img width="1680" alt="image" src="https://github.com/user-attachments/assets/540a0bae-b183-4c94-97d6-0ea8324746bd" />

The last run from the master: 
https://github.com/causify-ai/helpers/actions/runs/13912317248/job/38928910626
author_association: CONTRIBUTOR
user: login: dremdem
created_at: 2025-03-18T16:41:38Z
body: Filed separate issue about the matrix: 
https://github.com/causify-ai/csfy/issues/6462
author_association: CONTRIBUTOR
user: login: samarth9008
created_at: 2025-03-18T16:48:33Z
body: > Do we need the superslow GH action in the helpers repo since there are no superslow tests at all?

Well @heanhsok can answer that. But doesn't matter if its needed or not, we should still modify it to use to the GHCR registry.
author_association: CONTRIBUTOR
user: login: samarth9008
created_at: 2025-03-19T12:23:43Z
body: @dremdem 

How is it going with this one?
author_association: CONTRIBUTOR
user: login: dremdem
created_at: 2025-03-19T12:27:00Z
body: > @dremdem
> 
> How is it going with this one?

Seems like forgot to re-ask for your review. 
Can you review it pls? 
author_association: CONTRIBUTOR
user: login: samarth9008
created_at: 2025-03-19T14:23:18Z
body: lmk when its ready for the review
author_association: CONTRIBUTOR
user: login: dremdem
created_at: 2025-03-19T14:45:56Z
body: > lmk when its ready for the review

It's ready for review.
author_association: CONTRIBUTOR
user: login: samarth9008
created_at: 2025-03-19T15:52:19Z
body: We should also make similar change to linter and slow tests IMO
author_association: CONTRIBUTOR
user: login: dremdem
created_at: 2025-03-19T16:05:17Z
body: > We should also make similar change to linter and slow tests IMO

Done everywhere.
author_association: CONTRIBUTOR
user: login: dremdem
created_at: 2025-03-21T16:54:06Z
body: @samarth9008 
Whenever you have a moment, could you take a look please:
https://github.com/causify-ai/helpers/pull/374#discussion_r2006255823
author_association: CONTRIBUTOR
user: login: samarth9008
created_at: 2025-03-22T19:18:51Z
body: Something is not sitting right with the explanation

Initial in this comment-https://github.com/causify-ai/helpers/pull/374#discussion_r2005496645 it was mentioned that the PR in draft executes the workflows if triggered manually.

- IMO, no user would be interested in running a manual workflow on a draft state of the PR

Then in this comment - https://github.com/causify-ai/helpers/pull/374#discussion_r2006255823 it was explained that 

```
github.event.pull_request.draft == false
```

The above condition is working but due to `github.event.pull_request.draft` being set as an empty string when running the workflow manually. If the condition is evaluating as true anyhow, this shouldn't execute the workflow for a manual run.

Initially I thought we were solving a problem of draft PR running the workflow when executed manually but it seemed like that was resolved.

Could you explain 

- What problem are we solving?
- How was it produced?
- What solutions could be have?
author_association: CONTRIBUTOR