Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TCE-1145] Codacy Static Code Analysis Action Not Triggering from GitHub Workflow #512

Open
creig-with-an-E opened this issue Oct 21, 2024 · 1 comment
Labels
jira-issue Issue tracked on JIRA

Comments

@creig-with-an-E
Copy link

Description:

We have a repository integrated with Codacy for static code analysis. While the pipeline generally functions as expected, we occasionally encounter an issue where the "Codacy Static Code Analysis" action does not get triggered from the GitHub workflow. Despite successful pushes and the rest of the pipeline running normally, Codacy’s analysis doesn’t start. Even after waiting for extended periods (days), the action still does not get triggered or return any results.

The issue is intermittent but seems to occur more frequently after force pushes (git push --force) to branches.

Repository Workflow:

Our CI/CD pipeline is set up using GitHub Actions. Below is a summary of relevant details:

  1. Trigger Configuration:

    • The GitHub Actions workflow is set to trigger on any push to any branch.
    • Example yml workflow file configuration:
      on:
        push:
           branches:
                 - '**'
      
    • Force pushes are included in this configuration.
  2. Relevant Job Details:

    • After running the tests and generating code coverage, the workflow uploads coverage to Codacy using the Codacy CLI:
     - name: Install codacy CLI and upload coverage to codacy
         shell: bash
          run: |
               apt-get update && apt-get install -y curl
             bash <(curl -Ls https://coverage.codacy.com/get.sh)
          env:
              CODACY_API_TOKEN: ${{ secrets.CODACY_API_TOKEN }}
              CODACY_ORGANIZATION_PROVIDER: ${{ vars.CODACY_ORGANIZATION_PROVIDER }}
              CODACY_USERNAME: ${{ vars.CODACY_USERNAME }}
              CODACY_PROJECT_NAME: ${{ vars.CODACY_PROJECT_NAME }}
    
    
  3. Observed Behavior:

    • All other jobs within the workflow (e.g., linting, testing) complete successfully.
    • Occasionally, the Codacy analysis is not triggered. This occurs even after the successful upload of the coverage report.
    • The issue is intermittent and seems to correlate with force pushes.

Expected Behavior:

Upon any push to a branch, including force pushes, the Codacy static code analysis should be triggered automatically as part of the CI/CD pipeline.

Steps to Reproduce:

  • Make changes in the repository and force push (git push --force) to any branch.
  • Check the GitHub Actions run, ensuring all jobs complete successfully.
  • Observe whether the Codacy static code analysis is triggered.

Environment:

  • Repository Platform: GitHub
  • CI Tool: GitHub Actions
  • Static Analysis Tool: Codacy
  • Languages: Python
  • Dependency Manager: Poetry
  • Database Services Used in Pipeline: PostgreSQL, Redis
@github-actions github-actions bot changed the title Codacy Static Code Analysis Action Not Triggering from GitHub Workflow [TCE-1145] Codacy Static Code Analysis Action Not Triggering from GitHub Workflow Oct 21, 2024
@github-actions github-actions bot added the jira-issue Issue tracked on JIRA label Oct 21, 2024
Copy link

github-actions bot commented Oct 21, 2024

Internal ticket created : TCE-1145

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira-issue Issue tracked on JIRA
Projects
None yet
Development

No branches or pull requests

1 participant