Repository navigation
Conversation
- GIT_CREDENTIAL resolves a workspace git credential (user.gitcred.<name>) through the deploy manager, the same credentials My Apps and My Jobs use. The token goes into the clone only and is never logged or exported. - A full commit SHA as the URL fragment is checked out after cloning, since git clone -b accepts only branches and tags. - Dependency installation and setup.sh run without OSC_ACCESS_TOKEN, GIT_TOKEN and GITHUB_TOKEN, and before the parameter store is loaded; the store is loaded right before the worker runs. - Fix: a parameter store with no exports no longer aborts the run under set -e, and a failed config load is reported instead of exiting silently. - Install jq, which the token refresh already relied on. - Add entrypoint unit tests and a CI job for them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lufftre
force-pushed
the
feat/git-credential-and-safe-checkout
branch
from
November 3, 2026 09:31
0e0d7a0 to
3857170
Compare
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
My Jobs supports named workspace git credentials, but the
python-job-runnerservice only takes a rawGitHubToken. And today the runner loads the parameter store before installing dependencies and runningsetup.sh, so repository code that runs at install time (build backends,setup.py,setup.sh) sees every parameter-store secret plus the runner's own tokens.WORKER_CMDcan't protect against that, because it runs last.What changes
GIT_CREDENTIAL: the name of a workspace git credential (user.gitcred.<name>). The runner resolves it viaGET deploy.svc.<env>.osaas.io/mytenantsecrets/user.gitcred.<name>withOSC_ACCESS_TOKEN, used only when noGIT_TOKEN/GITHUB_TOKENis set. The token goes into the clone URL only (origin is reset to the clean URL afterwards); it is never logged or exported to the worker. An unknown name or failed lookup fails the run before anything executes.…/repo#<40 or 64 hex>) is checked out after a normal clone, sincegit clone -baccepts only branches and tags. A missing commit fails the run. Branch/tag fragments behave as before.setup.sh(withOSC_ACCESS_TOKEN,GIT_TOKEN,GITHUB_TOKENremoved from their environment) → load the parameter store → run the worker. The worker's environment is unchanged from today.set -e, a store with noexportlines aborted the run, and a failed config load exited without the error message; both are handled now.jqis installed (the token refresh already called it).tests/entrypoint_test.shplus aTestworkflow; README documents the variables and run order.Backwards compatible: existing
SOURCE_URL,GIT_TOKEN/GITHUB_TOKEN,CONFIG_SVC,SUB_PATH,WORKER_CMDbehave the same, except that install-time code no longer sees parameter-store values. A job whosesetup.shrelied on store values would need to move that into the worker.Platform work still needed
GitCredentialoption toeyevinn-python-job-runnerthat maps toGIT_CREDENTIAL, next toGitHubToken. The service'sDockerfile.osclives in the eyevinn-osaas fork, so it should pick upjqtoo.OSC_ACCESS_TOKENmust be allowed to readGET /mytenantsecrets/user.gitcred.*. If runner tokens shouldn't read tenant secrets, the deploy manager could instead resolve the credential at instance creation and inject it asGIT_TOKEN, as it does for My Jobs; the runner side here works either way.docker.ymlbuildsDockerfile.osc, which was removed from this repo, so that workflow fails on PRs independent of this change.Testing
bash tests/entrypoint_test.sh: URL/ref parsing, SHA detection, credential-name validation, credentials removed from the install environment,setup.shruns before config is loaded.42670c9…(checked out that commit),#main(branch), a nonexistent SHA (fails, exit 1), andGIT_CREDENTIALwith an invalid token (fails with HTTP 401 before running the worker). Not tested against a real registered credential or a live runner token.🤖 Generated with Claude Code