SHyx0rmZ / bitbucket-build-status-resource

A Concourse resource for interacting with Bitbucket servers
Other
19 stars 14 forks source link

Include build name in status description. #3

Closed ghost closed 6 years ago

ghost commented 6 years ago

This commit extends the "name" displayed on the Bitbucket Build status prefixing it with the "key". This has the effect that the link to the build doesn't show only the build number but also the job name, followed by the build number. It makes easier to distinguish the jobs in a pipeline containing more of them.

Before this commit: just-name

With this commit: key-name

SHyx0rmZ commented 6 years ago

I think it would be cleaner to not reuse key here. As far as I can tell, there's basically three cases:

If I understand you correctly, you now are in a situation where you have two keys, but only one BUILD_JOB_NAME, right? I'm assuming this happens when you have two puts in the same job?

If so, I can see the need to use key, but we should probably do something about the automatically generated key for one-off builds.

ghost commented 6 years ago

I've updated my PR according to the various comments: thanks! @SHyx0rmZ The problem is that (per Concourse docs) BUILD_NAME only has "The build number within the build's job." so regardless of where you put the resource you'll end up with a panel like the one I've attached in the first image where only numbers are shown but there's no way of telling (without clicking the link) which job those job numbers refer to.

This is way I came up with the idea to actually use BUILD_JOB_NAME-BUILD_NAME if the user doesn't overrides it and if both are defined (to exclude the One-off build).

SHyx0rmZ commented 6 years ago

@degano Updated Docker image available via tags v1.3.0 and latest.

ghost commented 6 years ago

@SHyx0rmZ thank you!