From 5dc81e0b57da9843e0c8cd1dc7b35d2d139a8062 Mon Sep 17 00:00:00 2001 From: Codex Date: Wed, 25 Nov 2026 20:07:44 +0000 Subject: [PATCH] Reuse existing Jenkins credential and trust isolated build checkout --- Jenkinsfile.final-project | 2 +- ci/OPERATIONS.txt | 5 +++-- ci/jenkins-job.xml | 29 +++++++++++++++++++++++++++++ ci/toolchain.sh | 1 + 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 ci/jenkins-job.xml diff --git a/Jenkinsfile.final-project b/Jenkinsfile.final-project index 3aaf636..fe813dc 100644 --- a/Jenkinsfile.final-project +++ b/Jenkinsfile.final-project @@ -23,7 +23,7 @@ mkdir -p out } stage('Retrieve exact Actions bundle') { steps { - withCredentials([string(credentialsId: 'final-project-gitea-read', variable: 'GITEA_TOKEN')]) { + withCredentials([string(credentialsId: 'gitea-jenkins-ci', variable: 'GITEA_TOKEN')]) { sh '''set +x set -eu python3 ci/final_project.py fetch --sha "$SOURCE_SHA" --run-id "$ACTIONS_RUN_ID" --attempt "$ACTIONS_ATTEMPT" --mode "$MODE" --output out/review-bundle.zip > out/actions-run.json diff --git a/ci/OPERATIONS.txt b/ci/OPERATIONS.txt index 2e09ef8..4901487 100644 --- a/ci/OPERATIONS.txt +++ b/ci/OPERATIONS.txt @@ -22,8 +22,9 @@ Jenkins setup (requires an authenticated administrator): 2. Pipeline from SCM: Git, existing public repository URL, branch */feature/final-ci-demo, Script Path Jenkinsfile.final-project. 3. Keep the existing myfileagent-python-ci required check unchanged. - 4. Create a Secret text credential final-project-gitea-read containing an - appropriately scoped Gitea read token. Do not store it in Git or chat. + 4. Reuse existing Jenkins credential gitea-jenkins-ci. Its installed + PersonalAccessTokenImpl implements StringCredentials and supports the + string binding used here; no credential value was read during setup. 5. Run once to load parameters; then Build with Parameters using the exact successful run SHA/ID/attempt. If branch HEAD has advanced, select the corresponding new successful run (pipeline refuses a checkout mismatch). diff --git a/ci/jenkins-job.xml b/ci/jenkins-job.xml new file mode 100644 index 0000000..023a3c5 --- /dev/null +++ b/ci/jenkins-job.xml @@ -0,0 +1,29 @@ + + + SSW590 Member 2 fixture pipeline. Simulated review, not live model evidence. Separate from the protected-main Python check. + false + + + + SOURCE_SHAFull SHA matching the selected Actions run and current Member 2 branch HEADtrue + ACTIONS_RUN_IDSuccessful exact Actions run IDtrue + ACTIONS_ATTEMPT1true + MODEfixture + + + + + + 2 + https://myfileagent.tech/myfileagent/myfileagent-pipeline.git + */feature/final-ci-demo + false + + + + Jenkinsfile.final-project + true + + + false + diff --git a/ci/toolchain.sh b/ci/toolchain.sh index df529bb..4e5a041 100755 --- a/ci/toolchain.sh +++ b/ci/toolchain.sh @@ -9,6 +9,7 @@ case "$1" in --mount type=volume,src=ssw590-final-project-state,dst=/state \ --workdir /work --entrypoint sleep "$image" 3600 docker cp . "$name:/work" + docker exec "$name" git config --global --add safe.directory /work ;; exec) shift; docker exec "$name" "$@" ;; collect) mkdir -p out/collected; docker cp "$name:/work/out/." out/collected/ ;;