Skip to content

atc: Check pinned resources whose pinned version doesn't exist in the version history#9652

Open
taylorsilva wants to merge 3 commits into
masterfrom
9646-checked-pinned-resources
Open

atc: Check pinned resources whose pinned version doesn't exist in the version history#9652
taylorsilva wants to merge 3 commits into
masterfrom
9646-checked-pinned-resources

Conversation

@taylorsilva

@taylorsilva taylorsilva commented Jul 22, 2026

Copy link
Copy Markdown
Member

Changes proposed by this PR

closes #9646

  • Adds an additional SQL filter to the Resources() func in the check factory. The check factory will now return resources that are pinned, but their pinned version does not exist in the version history of the resource. Once the pinned version is found the resource will no longer be checked
  • BuildStarter would create in-memory checks. I switched it to creating checks in the database. This ensures multiple checks aren't run across web nodes. Issue I ran into here is what prompted this change: check exits early if another check is running git-resource#479
  • Unrelated to the issue, but I noticed some of the tests I recently added in atc/db/build_test.go wouldn't fail in an expected manner due to the way the test was setup. That's now also resolved in this PR.

Suggested changes were initially made by Claude and the issue reporter here: https://github.com/fbehrens51/concourse/tree/fix/pinned-resource-lidar-check

Code is mostly unchanged besides a few nit changes I made to comments and naming. I did test the new query against the db backing https://ci.concourse-ci.org/ to ensure query performance did not degrade. Before/after EXPLAIN ANALYZE times are:

--Before
Planning Time: 1.273 ms
Execution Time: 17.694 ms

--After
Planning Time: 1.336 ms
Execution Time: 17.180 ms

I ran both versions of the query multiple times and the above times represent the average results I saw.

Signed-off-by: Taylor Silva <dev@taydev.net>
noticed some weird cases where a check container had multiple instances
of the `check` script running. Had a feeling it might be from this.
Decided to go with the more robust `toDb` which will de-dup across
multiple web nodes.

Signed-off-by: Taylor Silva <dev@taydev.net>
…sn't exist in the version history of the resource

I verified that the additional filter does not impact performance of the
query. A before/after on the query using `EXPLAIN ANALYZE` showed no
impact on the query's runtime.

Signed-off-by: Taylor Silva <dev@taydev.net>
@taylorsilva taylorsilva added this to the v8.3.0 milestone Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pinned resources that aren't build triggers are never re-checked once they have history (regression since 8.2.0 / #9492)

1 participant