Repository navigation
acc: share the CI env unset in an unset_ci_env helper - #7691
Conversation
|
Commit: Regression test reportSelected 3 changed tests (limit=20, 0 not selected) 3 tests: regression=0 unreleased=3 coverage=0 failing=0
TestAccept/air/image-push: branch ✅ | main (3db96fa) ✅ | latest (v1.26.0) ❌latest (v1.26.0): TestAccept/cmd/aitools/claude-config-dir: branch ✅ | main (3db96fa) ✅ | latest (v1.26.0) ❌latest (v1.26.0): TestAccept/cmd/aitools/telemetry/hint: branch ✅ | main (3db96fa) ✅ | latest (v1.26.0) ❌latest (v1.26.0): |
✅ Integration test reportCommit: 13578d5
Top 3 slowest tests (at least 2 minutes):
|
simonfaltum
left a comment
There was a problem hiding this comment.
🤖 Automated review from simonfaltum's review agent (pr-review skill) at 0486b26. Each finding was verified against the code; simonfaltum may follow up.
Not approving yet: 1 blocking issue(s), tagged [blocking].
This PR moves the CI / CI/CD-provider unset line, which was copied into three acceptance scripts, into a shared unset_ci_env helper in the root script.prepare. The helper commit itself is correct and follows the repo's conventions: its variable list matches listCiCdProviders in the pinned SDK, and the root prepare file is the right home for it. However, the branch still contains an older, pre-review revision of #7585 rather than the merged one, so it conflicts with main and its diff drags in stale #7585 code. Resolving those conflicts toward the branch would revert merged fixes, such as accepting CI=no/off. Please rebase so that only the helper commit sits on main, and refresh the description; note that #7692 edits the same three scripts.
| "github.com/stretchr/testify/require" | ||
| ) | ||
|
|
||
| // hintEnvVars are the non-detection env vars MaybeHint reads. They are cleared |
There was a problem hiding this comment.
[blocking] This branch is built on 07a831d, an older revision of #7585 from before its review feedback, not on the squash-merged #7585 (10fe968). GitHub reports the PR as not mergeable, with conflicts in six files: .nextchanges/cli/claude-code-native-hint.md, the three acceptance scripts, hint.go and hint_test.go. The PR diff also shows 21 files instead of the 5 the helper touches. If a conflict is resolved toward this branch, merged #7585 fixes come back undone. For example, inCI would go back to strconv.ParseBool, so CI=no or CI=off would count as CI again and drop the native hint. Also returning: hintEnvVars/unsetEnv (main now relies on testutil.SetAgentEnv clearing the env), the inline closure in place of the shared noRecordedPlugin, the extra plugin-manifest read, and the older .nextchanges entry. The description is also stale: #7585 is already merged, and main has no hintEnvVars, so after a rebase unset_ci_env is the only copy of the list. Please rebase with git rebase --onto origin/main 07a831d8a, which keeps only 0486b26 (it applies cleanly), and update the description.
There was a problem hiding this comment.
Rebased onto current main (now including #7692). The branch is the single helper commit (3de5e07), and the diff is 5 files. I also refreshed the description: it no longer mentions the stacking or hintEnvVars, and unset_ci_env is now the only copy of the list. I re-ran TestAccept/cmd/aitools and TestAccept/air in a clean env and with CI=true GITHUB_ACTIONS=true, plus the no-op negative control.
0486b26 to
193c480
Compare
Three acceptance scripts unset the same list of CI and CI/CD provider variables so the native Claude Code hint line also prints in CI. Move the list into one unset_ci_env helper in the root script.prepare, the only prepare file that covers both cmd/aitools and air, with a pointer to the SDK's useragent/cicd.go so it stays in sync. Co-authored-by: Isaac <no-reply@databricks.com>
193c480 to
3de5e07
Compare
| unset CLAUDE_CODE_SESSION_ID | ||
| # CI and the CI/CD provider markers the SDK detects (GitHub Actions sets both). | ||
| unset CI GITHUB_ACTIONS GITLAB_CI JENKINS_URL TF_BUILD CIRCLECI TRAVIS BITBUCKET_BUILD_NUMBER PROJECT_ID CODEBUILD_BUILD_ARN TFC_RUN_ID | ||
| unset_ci_env |
There was a problem hiding this comment.
Non-blocking: this duplicates the comment on unset_ci_env in acceptance/script.prepare. I'd drop it here and in acceptance/cmd/aitools/telemetry/hint/script.
There was a problem hiding this comment.
Done in 13578d5: I dropped the comment from both aitools scripts. I left air/image-push alone because its comment explains why the CI vars matter in that test specifically.
The helper in acceptance/script.prepare already documents the list. Co-authored-by: Isaac <no-reply@databricks.com>
simonfaltum
left a comment
There was a problem hiding this comment.
🤖 Automated review from simonfaltum's review agent (pr-review skill) at 13578d5. Each finding was verified against the code; simonfaltum may follow up.
No blocking issues found, approving. 1 non-blocking comment(s) and 2 question(s) below.
This PR moves the CI / CI/CD-provider unset line, which was copied into three acceptance scripts, into a shared unset_ci_env helper in the root script.prepare, and lists the helper in testing.md. The variable list matches listCiCdProviders in the pinned SDK, all three call sites keep their behavior, no other copy remains, and CI is green. The earlier rebase request and the duplicated-comment suggestion are both handled. One nit is open (link the SDK file in the sync note), plus two non-blocking questions: whether to clear the CI markers in the harness, and how to keep the list in sync on SDK bumps.
Questions
- The Go harness already clears the AI-agent markers and
CLAUDE_CODE_CHILD_SESSIONfor every test (acceptance/acceptance_test.go:253-289). The CI markers are cleared only in tests that callunset_ci_env. A new native-hint test that forgets the call would record the hint locally and lose it on GitHub Actions; one that asserts no hint would pass there without testing anything. Did you consider clearing the CI markers in the harness instead? That would also make thecicd/...Repl inacceptance/cmd/api/test.tomlunnecessary, though it could change other goldens that depend onCI. Keeping it opt-in is fine if that's deliberate. (non-blocking) unset_ci_envis a hand copy of the SDK's unexportedlistCiCdProviders, and only its own comment asks for it to be kept in sync..agents/skills/bump-sdk/SKILL.mddoesn't mention it, and it doesn't mention the agent list inacceptance_test.goeither. Is the comment enough, or would a line in the bump-sdk skill that names these hand-copied SDK lists be worth adding (here or in a follow-up)? (non-blocking)
|
|
||
| # unset_ci_env clears CI and the CI/CD provider markers, so a test behaves the | ||
| # same in CI as on a laptop. The provider list mirrors listCiCdProviders in the | ||
| # Go SDK's useragent/cicd.go (read by useragent.CiCdProvider()); keep it in |
There was a problem hiding this comment.
[nit] The sync note names useragent/cicd.go but doesn't link it. .agents/rules/comments.md asks for a source URL when code detects environment variables, and the sibling aitools code does that (libs/aitools/agents/hint.go:26 links useragent/agent.go). Without a link, whoever syncs the list on the next SDK bump has to find the repo and file themselves. Add # https://github.com/databricks/databricks-sdk-go/blob/main/useragent/cicd.go to the comment.
Changes
Adds an
unset_ci_envhelper toacceptance/script.prepare. It replaces the three copies of the CI and CI/CD providerunsetline incmd/aitools/claude-config-dir,cmd/aitools/telemetry/hintandair/image-push. The helper's comment points atlistCiCdProvidersin the Go SDK'suseragent/cicd.goso the list stays in sync. The helper is also listed in the built-in helpers section of.agents/rules/testing.md.Why
Addresses simonfaltum's review comment on #7585 about the duplicated line. The helper lives in the root
script.preparebecause that is the only prepare file that covers bothcmd/aitoolsandair. After this change,unset_ci_envis the only copy of the list.Tests
go test ./acceptance -run TestAccept/cmd/aitools(14 dirs) and-run TestAccept/air(24 dirs) both pass with no golden changes. They pass in a clean env and withCI=true GITHUB_ACTIONS=trueexported.cmd/aitools/telemetry/hint,cmd/aitools/claude-config-dirandair/image-pushall fail.This pull request and its description were written by Isaac.