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 (ci): Allow opentelemetry-python forks to use CI #3190

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jsoref
Copy link
Contributor

@jsoref jsoref commented Jan 15, 2025

Description

Adds CORE_REPO and CONTRIB_REPO inputs and corresponding environment variables to allow people to use CI in forks of https://github.com/open-telemetry/opentelemetry-python

Type of change

Please delete options that are not relevant.

  • 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 not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Does This PR Require a Core Repo Change?

There is a corresponding change that should be made but it it can be done after this is merged.

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

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

@jsoref jsoref requested a review from a team as a code owner January 15, 2025 17:17
@aabmass aabmass added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Jan 15, 2025
CORE_REPO_SHA: main
CONTRIB_REPO: open-telemetry/opentelemetry-python-contrib
Copy link
Member

Choose a reason for hiding this comment

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

Does this need to be${{ github.repository }} so users can run tests of contrib forks too? Just going off of symmetry here

Copy link
Contributor Author

@jsoref jsoref Jan 15, 2025

Choose a reason for hiding this comment

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

Sorry, i can't think through what it should be at this time. If i have time/energy when I'm not at work, I can try to reason it out.

what I put here is almost certainly wrong, but the various templates and indirections are making me way too dizzy.

Copy link
Member

@emdneto emdneto Jan 15, 2025

Choose a reason for hiding this comment

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

@aabmass I think this is not needed, because checkout action already does the trick for us, including forks.
Example In my fork: https://github.com/emdneto/opentelemetry-python-contrib/actions/runs/12788418223/job/35649787442

This variable has no use though

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In principle, I believe, this could be needed if someone was trying to test a change to their opentelemetry-python repository that needed changes to their opentelemetry-python-contrib repository at the same time (which is more or less what we're looking at in open-telemetry/opentelemetry-python#4388 where things conceptually didn't work for https://github.com/jsoref/opentelemetry-python/actions/runs/12793563878 because the callee doesn't yet have the required feature).

I'm not saying it's working, but I suspect a thing like it would be needed. I'm also not entirely certain it would always work/would work in this case (I think you can't really programmatically change a called workflow target, so in this specific case it wouldn't, but for a normal case, of code as opposed to workflow dependencies, I think it'd be useful).

@@ -682,10 +682,11 @@ allowlist_externals =
sh

setenv =
; override CORE_REPO via env variable when testing in forks
CORE_REPO=git+https://github.com/{env:CORE_REPO:open-telemetry/opentelemetry-python}.git@{env:CORE_REPO_SHA}
Copy link
Member

@emdneto emdneto Jan 15, 2025

Choose a reason for hiding this comment

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

I would say to have less intrusive changes to CI, maybe just use the GITHUB_REPOSITORY runtime environment variable here? Like

Suggested change
CORE_REPO=git+https://github.com/{env:CORE_REPO:open-telemetry/opentelemetry-python}.git@{env:CORE_REPO_SHA}
CORE_REPO=git+https://github.com/{env:GITHUB_REPOSITORY:open-telemetry/opentelemetry-python}.git@{env:CORE_REPO_SHA}

At CI this will point to the current owner and repository name, so when running in your fork, it should match your check-spelling-sandbox/opentelemetry-python. This will make tox look at your fork+revision correctly


```sh
CORE_REPO=check-spelling-sandbox/opentelemetry-python
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
CORE_REPO=check-spelling-sandbox/opentelemetry-python
GITHUB_REPOSITORY=your-fork/opentelemetry-python tox

Based on my previous comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants