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

Fix git pull error in core contrib test #3357

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

Conversation

jomcgi
Copy link
Contributor

@jomcgi jomcgi commented Mar 12, 2025

Description

Core contrib is intermittently failing when pulling the core repo in tox.
Add gh actions/checkout for the core repo before running tox to mitigate this.

As the error is transient I'm not 100% sure that this resolves it but I have not encountered it with any of the GH Actions that have been triggered.

Fixes #3352

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Tested with CI on this PR

Does This PR Require a Core Repo Change?

  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@jomcgi jomcgi force-pushed the bug-3352/fix-transient-ci-git-errors branch 2 times, most recently from ff2f9e6 to 021c31b Compare March 12, 2025 16:22
@jomcgi jomcgi changed the title [WIP] Fix transient CI errors with tox/git retry Fix transient CI errors with tox/git retry Mar 12, 2025
@jomcgi jomcgi marked this pull request as ready for review March 12, 2025 17:29
@jomcgi jomcgi requested a review from a team as a code owner March 12, 2025 17:29
Copy link
Member

@emdneto emdneto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My idea for this one would be just do a actions/checkout first. If checkout works, it means will be able to install things from that revision

@jomcgi
Copy link
Contributor Author

jomcgi commented Mar 12, 2025

My idea for this one would be just do a actions/checkout first. If checkout works, it means will be able to install things from that revision

We already do a checkout before hitting this error, the actions/checkout action has a retry built in which is why we do not see this error there.

I couldn't see a flag for tox that would let us use the output of that checkout in tox -e ...

    runs-on: ubuntu-latest
    steps:
      - name: Checkout contrib repo @ SHA - ${% raw %}{{ env.CONTRIB_REPO_SHA }}{% endraw %}
        uses: actions/checkout@v4
        with:
          repository: open-telemetry/opentelemetry-python-contrib
          ref: ${% raw %}{{ env.CONTRIB_REPO_SHA }}{% endraw %}

      - name: Set up Python 3.8
        uses: actions/setup-python@v5
        with:
          python-version: "3.8"
          architecture: "x64"

      - name: Install tox
        run: pip install tox-uv

      - name: Run tests
        run: tox -e {{ job_data.tox_env }} -- -ra

The revision always exists (it's used for all of the other actions that run successfully and the previous checkout step) but we fail without retry when tox pulls it in Run tests.

@emdneto
Copy link
Member

emdneto commented Mar 12, 2025

My idea for this one would be just do a actions/checkout first. If checkout works, it means will be able to install things from that revision

We already do a checkout before hitting this error, the actions/checkout action has a retry built in which is why we do not see this error there.

I couldn't see a flag for tox that would let us use the output of that checkout in tox -e ...

    runs-on: ubuntu-latest
    steps:
      - name: Checkout contrib repo @ SHA - ${% raw %}{{ env.CONTRIB_REPO_SHA }}{% endraw %}
        uses: actions/checkout@v4
        with:
          repository: open-telemetry/opentelemetry-python-contrib
          ref: ${% raw %}{{ env.CONTRIB_REPO_SHA }}{% endraw %}

      - name: Set up Python 3.8
        uses: actions/setup-python@v5
        with:
          python-version: "3.8"
          architecture: "x64"

      - name: Install tox
        run: pip install tox-uv

      - name: Run tests
        run: tox -e {{ job_data.tox_env }} -- -ra

The revision always exists (it's used for all of the other actions that run successfully and the previous checkout step) but we fail without retry when tox pulls it in Run tests.

I mean, checkout core repo at the core repo revision we want before the contrib one. We only have this problem for core_contrib_tests, which we test instrumentation libraries against a revision of Core. So, checkout core at that revision and use it

@jomcgi
Copy link
Contributor Author

jomcgi commented Mar 13, 2025

I mean, checkout core repo at the core repo revision we want before the contrib one. We only have this problem for core_contrib_tests, which we test instrumentation libraries against a revision of Core. So, checkout core at that revision and use it

Understood - I'll update my PR so that it only adds that checkout for core_contrib tests.

@jomcgi jomcgi force-pushed the bug-3352/fix-transient-ci-git-errors branch from 021c31b to 677d607 Compare March 13, 2025 07:54
@jomcgi jomcgi changed the title Fix transient CI errors with tox/git retry Fix git pull error in core contrib test Mar 13, 2025
@jomcgi jomcgi force-pushed the bug-3352/fix-transient-ci-git-errors branch from 677d607 to 9932189 Compare March 13, 2025 07:59
Core contrib is intermittently failing when
pulling the core repo in tox.
Add gh actions/checkout for the core repo
before running tox to mitigate this.
@jomcgi jomcgi force-pushed the bug-3352/fix-transient-ci-git-errors branch from 9932189 to 5764d8b Compare March 13, 2025 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

infra: core-contrib-tests randomly fails
2 participants