Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Easy way to get the squad URL for a build? #62

Open
jscook2345 opened this issue Jul 17, 2020 · 3 comments
Open

Easy way to get the squad URL for a build? #62

jscook2345 opened this issue Jul 17, 2020 · 3 comments

Comments

@jscook2345
Copy link
Contributor

Currently I'm building a squad URL in my code, but I wondered if there was an easier way to get this?

If not, where do you think would be a good place for this? Data in squad or something in squad-client?

ex:

build_details_url = urljoin(SquadApi.url, '%s/%s/build/%s' % (group.slug, project.slug, build.version))

# https://qa-reports.linaro.org/lkft/linux-next-oe/build/next-20200713
@chaws
Copy link
Collaborator

chaws commented Jul 24, 2020

Hey Justin,

You mean url for UI right? I guess this could go to squad-client. I think it could be a method of each object that when called, it would return the url you're asking for. Let me give it a try

@jscook2345
Copy link
Contributor Author

Correct, this link would go to the UI. It would be good for some of our reports to link back to squad or lava if the user would like to deep dive on issues.

@jscook2345
Copy link
Contributor Author

This is what I've been using in our code to replicate this:

def squad_build_url(squad_url, group, project, build):
    return requests.compat.urljoin(
        SquadApi.url, "/".join([group.slug, project.slug, "build", build.version])
    )

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants