Skip to content

Prevent resources from emitting empty versions - #9293

Merged
taylorsilva merged 2 commits into
concourse:masterfrom
IvanChalukov:issue-9279
Sep 12, 2025
Merged

taylorsilva merged 2 commits into
concourse:masterfrom
IvanChalukov:issue-9279

Conversation

@IvanChalukov

Copy link
Copy Markdown
Contributor

Changes proposed by this PR

closes #9279

Resources should not be allowed to emit empty versions ({}). Currently, Concourse accepts them, which results in confusing behavior:

  • They render in the UI as a blank/empty rectangle.
  • They are stored in the database as {}, which has no semantic meaning.

This PR filters out empty versions before they are persisted and provide a clear error message in the UI, so users know their resource is misconfigured and can update its configuration.

Notes to reviewer

To validate it:

  1. Add it to a pipeline:
resource_types:
  - name: mock-empty
    type: registry-image
    source:
      repository: concourseteam/mock-resource
      tag: empty-version

resources:
  - name: mock
    type: mock-empty

jobs:
  - name: job
    plan:
      - get: mock
  1. Output:
image

@taylorsilva taylorsilva left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am good with this being the solution to #9279. Thank you Ivan! Only one suggestion, then I'm happy to merge this in.

Comment thread atc/db/resource_config_scope.go Resolved
@taylorsilva taylorsilva added this to the v8.0.0 milestone Sep 10, 2025
@taylorsilva taylorsilva moved this from Todo to In Progress in Pull Requests Sep 10, 2025
@IvanChalukov
IvanChalukov marked this pull request as ready for review September 10, 2025 16:20
@IvanChalukov
IvanChalukov requested a review from a team September 10, 2025 16:20
@IvanChalukov

Copy link
Copy Markdown
Contributor Author

One more note: this is technically a breaking change for anyone using resources that emit empty versions(I hope no one is doing this). It’s probably worth calling out in the upcoming release notes.

@taylorsilva

Copy link
Copy Markdown
Member

That is a fair point. I'll make sure it's listed under breaking changes.

@Kump3r Kump3r left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested with local Concourse:
Without the change (code from master):
without-pr-code
With the change (code from PR):
with-pr-code
Also I see the following info message in the logs:

web-1     | {"timestamp":"2025-09-12T10:55:59.811931047Z","level":"info","source":"atc","message":"atc.tracker-imb.run.errored","data":{"build":"check","error":"save versions: resource output version is empty. Version must contain at least one key-value pair","pipeline":"test-empty","pre_build_id":12,"resource":"mock","session":"23.11","team":"main"}}

LGTM!

@taylorsilva
taylorsilva merged commit 6b18568 into concourse:master Sep 12, 2025
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Pull Requests Sep 12, 2025
aliculPix4D added a commit to Pix4D/s3-resource-simple that referenced this pull request Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Resources can emit empty versions

3 participants