Skip to content

Conversation

@PentaHelix
Copy link

@PentaHelix PentaHelix commented Jan 8, 2026

Changes proposed by this PR

get steps provide their metadata to the job as build variables

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 8, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: PentaHelix / name: Jakob Kuen (1d1224e)

return nil
}

func AsMap(metadata []atc.MetadataField) map[string]any {
Copy link
Author

Choose a reason for hiding this comment

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

There is probably a better place for this function

Copy link
Member

Choose a reason for hiding this comment

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

I'd add it onto a new type of []MetadataField here:

type MetadataField struct {
Name string `json:"name"`
Value string `json:"value"`
}

Something like:

type Metadata []MetadataField

func (m Metadata) AsMap() map[string]any {
	result := make(map[string]any, len(m))
	for _, v := range m {
		result[v.Name] = v.Value
	}
	return result
}

Then VersionResult can also use that type:

type VersionResult struct {
Version atc.Version `json:"version"`
Metadata []atc.MetadataField `json:"metadata,omitempty"`
}

Then AsMap(versionResult.Metadata) would become versionResult.Metadata.AsMap()!

@taylorsilva
Copy link
Member

@PentaHelix Thanks for the PR! I have added you the all team in the concourse github org, which will allow you to see the build logs for the PR checks. You'll probably get an email to accept the invite.

@PentaHelix PentaHelix marked this pull request as ready for review January 11, 2026 09:01
@PentaHelix PentaHelix requested a review from a team as a code owner January 11, 2026 09:01
@taylorsilva
Copy link
Member

Thanks for the PR! Will review after I get 8.0 out.

Copy link
Member

@taylorsilva taylorsilva left a comment

Choose a reason for hiding this comment

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

LGTM! I suggested how you can refactor AsMap() if you want to. As-is though, this works as expected.

Given this pipeline:

resources:
  - name: metadata
    type: mock
    source:
      metadata:
        - name: hello
          value: from metadata
        - name: hope
          value: it works!

jobs:
  - name: job
    plan:
      - get: metadata
      - task: echo
        config:
          platform: linux
          image_resource:
            type: mock
            source:
              mirror_self: true
          run:
            path: bash
            args:
              - -c
              - |
                echo ((.:metadata.hello))
                echo ((.:metadata.hope))

It worked!

image

If you don't have time to refactor I'll merge it as-is and refactor it later. Let me know. Thanks again for the PR!

return nil
}

func AsMap(metadata []atc.MetadataField) map[string]any {
Copy link
Member

Choose a reason for hiding this comment

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

I'd add it onto a new type of []MetadataField here:

type MetadataField struct {
Name string `json:"name"`
Value string `json:"value"`
}

Something like:

type Metadata []MetadataField

func (m Metadata) AsMap() map[string]any {
	result := make(map[string]any, len(m))
	for _, v := range m {
		result[v.Name] = v.Value
	}
	return result
}

Then VersionResult can also use that type:

type VersionResult struct {
Version atc.Version `json:"version"`
Metadata []atc.MetadataField `json:"metadata,omitempty"`
}

Then AsMap(versionResult.Metadata) would become versionResult.Metadata.AsMap()!

@taylorsilva taylorsilva moved this from Todo to Waiting on Contributor in Pull Requests Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Waiting on Contributor

Development

Successfully merging this pull request may close these issues.

2 participants