Skip to content

[TT-14557] Send logs of failed actions to GH logs analyser #7042

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lghiur
Copy link
Collaborator

@lghiur lghiur commented May 5, 2025

User description

Description

Related Issue

Motivation and Context

How This Has Been Tested

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring or add test (improvements in base code or adds test coverage to functionality)

Checklist

  • I ensured that the documentation is up to date
  • I explained why this PR updates go.mod in detail with reasoning why it's required
  • I would like a code coverage CI quality gate exception and have explained why

PR Type

Enhancement


Description

  • Add report_logs job to all main GitHub Actions workflows

  • Integrate GH logs analyser for failed jobs reporting

  • Ensure logs are uploaded if PR is not a draft

  • Standardize log reporting across CI, lint, release, and update workflows


Changes walkthrough 📝

Relevant files
Enhancement
ci-tests.yml
Add GH logs analyser job to CI tests workflow                       

.github/workflows/ci-tests.yml

  • Added a report_logs job to upload failed job logs.
  • Integrated GH logs analyser action with required secrets.
  • Job runs if PR is not a draft and after test job.
  • +14/-0   
    lint-swagger.yml
    Add GH logs analyser job to lint-swagger workflow               

    .github/workflows/lint-swagger.yml

  • Introduced report_logs job for failed job log uploads.
  • Uses GH logs analyser action with necessary tokens.
  • Job depends on redocly_validator and diff_swagger jobs.
  • +14/-0   
    lint.yml
    Add GH logs analyser job to lint workflow                               

    .github/workflows/lint.yml

  • Added report_logs job for uploading failed job logs.
  • Integrated GH logs analyser with token inputs.
  • Job runs after godoc and jira jobs if PR is not a draft.
  • +15/-0   
    release-tests.yml
    Add GH logs analyser job to release-tests workflow             

    .github/workflows/release-tests.yml

  • Added report_logs job to handle failed job log uploads.
  • Uses GH logs analyser action with required secrets.
  • Job depends on opentelemetry-e2e, ci-tests, and smoke-tests.
  • +14/-0   
    release.yml
    Add GH logs analyser job to release workflow                         

    .github/workflows/release.yml

  • Introduced report_logs job for uploading failed job logs.
  • Integrated GH logs analyser action with secrets.
  • Job runs after main release and test jobs.
  • +14/-0   
    update-tyk-analytics.yml
    Add GH logs analyser job to update-tyk-analytics workflow

    .github/workflows/update-tyk-analytics.yml

  • Added report_logs job for failed job log uploads.
  • Uses GH logs analyser action with necessary tokens.
  • Job depends on sync job.
  • +13/-0   

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • @buger
    Copy link
    Member

    buger commented May 5, 2025

    💔 The detected issue is not in one of the allowed statuses 💔

    Detected Status Closed
    Allowed Statuses In Dev,In Code Review,Ready for Testing,In Test,In Progress,In Review ✔️

    Please ensure your jira story is in one of the allowed statuses

    Copy link
    Contributor

    github-actions bot commented May 5, 2025

    API Changes

    no api changes detected

    Copy link
    Contributor

    github-actions bot commented May 5, 2025

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Workflow Integration

    Ensure the new report_logs job is correctly integrated and triggers only when intended, especially regarding the needs and if conditions for non-draft PRs.

    report_logs:
      runs-on: ubuntu-latest
      needs: [test]
      if: ${{ !github.event.pull_request.draft }}
      name: Report GH Logs on Failure
      permissions:
        actions: read
        contents: read
      steps:
        - name: Upload failed job logs
          uses: TykTechnologies/github-actions/.github/actions/gh-logs-analyser@main
          with:
            github_token: ${{ secrets.GITHUB_TOKEN }}
            gh_logs_analyser_token: ${{ secrets.GH_LOGS_ANALYSER }}
    Token and Secret Usage

    Validate that the correct secrets (GITHUB_TOKEN and GH_LOGS_ANALYSER) are available and securely referenced in all workflows using the gh-logs-analyser action.

    report_logs:
      runs-on: ubuntu-latest
      needs: [godoc, jira]
      if: ${{ !github.event.pull_request.draft }}
      name: Report GH Logs on Failure
      permissions:
        actions: read
        contents: read
      steps:
        - name: Upload failed job logs
          uses: TykTechnologies/github-actions/.github/actions/gh-logs-analyser@main
          with:
            github_token: ${{ secrets.GITHUB_TOKEN }}
            gh_logs_analyser_token: ${{ secrets.GH_LOGS_ANALYSER }}
    Consistency Across Workflows

    Confirm that the report_logs job is consistently configured across all workflows, including dependencies, permissions, and step usage.

    report_logs:
      runs-on: ubuntu-latest
      needs: [sync]
      name: Report GH Logs on Failure
      permissions:
        actions: read
        contents: read
      steps:
        - name: Upload failed job logs
          uses: TykTechnologies/github-actions/.github/actions/gh-logs-analyser@main
          with:
            github_token: ${{ secrets.GITHUB_TOKEN }}
            gh_logs_analyser_token: ${{ secrets.GH_LOGS_ANALYSER }}

    Copy link
    Contributor

    github-actions bot commented May 5, 2025

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    @buger
    Copy link
    Member

    buger commented May 5, 2025

    💔 The detected issue is not in one of the allowed statuses 💔

    Detected Status Closed
    Allowed Statuses In Dev,In Code Review,Ready for Testing,In Test,In Progress,In Review ✔️

    Please ensure your jira story is in one of the allowed statuses

    Copy link

    sonarqubecloud bot commented May 5, 2025

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    3 participants