akuity / kargo

Application lifecycle orchestration

Home Page:https://kargo.akuity.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature: add the Stage link to the Pull Request Promotion created PR

wanghong230 opened this issue · comments

Pull Request Promotion should add the Kargo stage link to the description also.

I can pick this up if needed

I'm assuming with Stage Link we referring to the URL for a stage so as to navigate from a PR to the Kargo Dashboard?

@krancour I'm not entirely sure on how to accomplish this, since the code that is creating the pull request is a few levels down and this code doesn't know anything about where it is deployed. Unless I'm missing something overly obvious.

@webstradev I hadn't looked at this one too carefully just yet, but your initial assessment of things sounds correct. The code that opens PRs doesn't have any existing awareness of where the API server / UI is deployed (if it's even deployed at all).

I think you might be able to get project and stage name easily enough, so then it's just a question of how to turn those two bits of information into a URL...

I suspect that this won't be the last time we need to do something of this nature, so I think we might want to consider building some kind of utility that globally yields easy access to API server proto + hostname.

@webstradev I hadn't looked at this one too carefully just yet, but your initial assessment of things sounds correct. The code that opens PRs doesn't have any existing awareness of where the API server / UI is deployed (if it's even deployed at all).

I think you might be able to get project and stage name easily enough, so then it's just a question of how to turn those two bits of information into a URL...

I suspect that this won't be the last time we need to do something of this nature, so I think we might want to consider building some kind of utility that globally yields easy access to API server proto + hostname.

This makes sense to me and I was thinking about something similar, though I'm not entirely certain how to accomplish it, as I suspect using os.Hostname() isn't enough because that would give an interal hostname within the cluster not something exposed externally that a user could access right?