Pix4D / cogito

Concourse resource for GitHub Commit Status and Google Chat notifications
MIT License
35 stars 14 forks source link

Build links for instanced pipelines don't work #148

Closed jamiegosling closed 3 months ago

jamiegosling commented 5 months ago

We use Instanced Pipelines, and the build links we get for them in GitHub don't appear to work. Here is an example of a link from cogito:

https://concourse/teams/teamname/pipelines/pipeline_name/jobs/job_name/builds/5?vars=%7B%22DEPLOYMENTID%22%3A%222%22%2C%22DESC%22%3A%22Daily+tests+for+Preprod+2%22%2C%22TITLE%22%3A%22PREPROD+TESTS%22%7D

an example of a working link for the above build

https://concourse/teams/teamname/pipelines/pipeline_name/jobs/job_name/builds/5?vars.DEPLOYMENTID=%222%22&vars.DESC=%22Daily%20tests%20for%20Preprod%202%22&vars.TITLE=%22PREPROD%20TESTS%22

marco-m-pix4d commented 5 months ago

Hello @jamiegosling, thanks for reporting. Sounds unexpected to me, I remember this was working 🤔 The code in question is https://github.com/Pix4D/cogito/blob/9328bb40a64cb2e96797ccb9a15ec27b28365711/cogito/putter.go#L336-L340

What is the cogito version you are using? You can see it as the first line output of any step:

[INFO]  cogito: This is the Cogito GitHub status resource.
    Tag: 0.12.0, commit: a18efc3, build date: 2023-11-03
jamiegosling commented 5 months ago

Hi @marco-m-pix4d,

Looks like we're on the latest version:

This is the Cogito GitHub status resource. Tag: 0.12.0, commit: a18efc3, build date: 2023-11-03

Looking at it I wonder if it needs a function to convert the JSON instance vars into URL parameters in the format vars.parameter1=value1&parameter2=value2?

aliculPix4D commented 5 months ago

Sounds unexpected to me, I remember this was working

@marco-m-pix4d can it be that it changed depending on the Concourse version? this is still "experimental" feature subject to changes.

Instanced Pipelines/Instance Groups are currently experimental, and are subject to change.

@jamiegosling just curious a bit, which Concourse version you are using?

marco-m-pix4d commented 5 months ago

can it be that it changed depending on the Concourse version?

Possible. In any case, this makes me think that in general from Cogito we could hit a Concourse endpoint that returns its version and log it, this could be helpful for troubleshooting in general...

aliculPix4D commented 5 months ago

Possible. In any case, this makes me think that in general from Cogito we could hit a Concourse endpoint that returns its version and log it, this could be helpful for troubleshooting in general...

Yes, we have it in header of every request.

X-Concourse-Version: 7.X.X

marco-m-pix4d commented 5 months ago

Ah even better! Good catch.

jamiegosling commented 4 months ago

Sounds unexpected to me, I remember this was working

@marco-m-pix4d can it be that it changed depending on the Concourse version? this is still "experimental" feature subject to changes.

Instanced Pipelines/Instance Groups are currently experimental, and are subject to change.

@jamiegosling just curious a bit, which Concourse version you are using?

@aliculPix4D we are using Concourse v7.10.0

aliculPix4D commented 4 months ago

My attempt to fix this: https://github.com/Pix4D/cogito/pull/153