Skip to content

Comments

acc: add Distinct option to [[Repls]]#3676

Merged
denik merged 5 commits intomainfrom
denik/acc-distinct
Sep 29, 2025
Merged

acc: add Distinct option to [[Repls]]#3676
denik merged 5 commits intomainfrom
denik/acc-distinct

Conversation

@denik
Copy link
Contributor

@denik denik commented Sep 29, 2025

Changes

New Distinct option to [[Repls]]. Allows distinguishing different values of numeric ID instead of blending them all into single replacement.

https://chatgpt.com/s/cd_68da505c977c8191b80e26a298d3658e

Why

Replacements like NUMID and UNIX_TIME_NANOS lump different numbers and timestamps together but it's sometimes important to distinguish those (e.g. track id change or timestamp change).

For example, in this test https://github.com/databricks/cli/pull/3636/files#diff-d3f08b9d7e364b3acdac435ed772aaf58a092e853b671a8e6de1ef4790e0a4f4R81 it would be useful to see that only one library shows up in changes because the other one has the same timestamp.

Tests

New selftest.

@denik denik temporarily deployed to test-trigger-is September 29, 2025 09:41 — with GitHub Actions Inactive
@eng-dev-ecosystem-bot
Copy link
Collaborator

eng-dev-ecosystem-bot commented Sep 29, 2025

Run: 18097604649

Env ✅​pass 🔄​flaky 🙈​skip
✅​ aws linux 312 532
✅​ aws windows 313 531
✅​ aws-ucws linux 425 429
✅​ aws-ucws windows 426 428
✅​ azure linux 312 531
✅​ azure windows 313 530
✅​ azure-ucws linux 425 428
✅​ azure-ucws windows 426 427
🔄​ gcp linux 308 3 533
🔄​ gcp windows 309 3 532
Test Name gcp linux gcp windows
TestAccept 🔄​flaky 🔄​flaky
TestAccept/bundle/deploy/pipeline/allow-duplicate-names 🔄​flaky ✅​pass
TestAccept/bundle/deploy/pipeline/allow-duplicate-names/DATABRICKS_BUNDLE_ENGINE=direct-exp 🔄​flaky ✅​pass
TestAccept/bundle/templates/default-python/integration_classic ✅​pass 🔄​flaky
TestAccept/bundle/templates/default-python/integration_classic/DATABRICKS_BUNDLE_ENGINE=direct-exp/UV_PYTHON=3.12 ✅​pass 🔄​flaky

@denik denik temporarily deployed to test-trigger-is September 29, 2025 10:40 — with GitHub Actions Inactive
@denik denik marked this pull request as ready for review September 29, 2025 10:41
@denik denik temporarily deployed to test-trigger-is September 29, 2025 11:59 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is September 29, 2025 12:51 — with GitHub Actions Inactive

nextIndex := 0
seen := make(map[string]int)
s = repl.Old.ReplaceAllStringFunc(s, func(match string) string {
Copy link
Contributor

Choose a reason for hiding this comment

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

These only apply in the context of a single file? Should we the index map global across all files in a test? Or is that not worth it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question, only going for single file there for simplicity.

@@ -1,5 +1,7 @@
cd this_dab

touch ../other_dab/dist/lib/other_test_code-0.0.1-py3-none-any.whl # ensure timestamp is different
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
touch ../other_dab/dist/lib/other_test_code-0.0.1-py3-none-any.whl # ensure timestamp is different
touch ../other_dab/dist/lib/other_test_code-0.0.1-py3-none-any.whl # create file at runtime to ensure that the mtime timestamp is different from the wheel in this_dab

nit: clarifying the comment a bit helps here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The file already exists, I'm just updating mtime.

@denik denik added this pull request to the merge queue Sep 29, 2025
Merged via the queue into main with commit ddbf610 Sep 29, 2025
13 checks passed
@denik denik deleted the denik/acc-distinct branch September 29, 2025 15:55
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.

4 participants