Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

list pipeline api endpoint should be more elaborate #75

Closed
TimoKramer opened this issue Apr 1, 2020 · 4 comments
Closed

list pipeline api endpoint should be more elaborate #75

TimoKramer opened this issue Apr 1, 2020 · 4 comments

Comments

@TimoKramer
Copy link
Member

TimoKramer commented Apr 1, 2020

I am thinking about a solution for a more elaborate query of the pipeline endpoint. I think group and name could be left like it is but then I would prefer to have them work on their own, too. Like this

./wendy --name test | jq .
[
  {
    "name": "dev:test",
    "data": {
...
  }
]

that would need a sql query that works based on a regex like this maybe:

SELECT p.name, p.image
FROM "pipelines" p
WHERE p.name LIKE '%:test'

The other option would be to offer entering the name of the pipeline as a whole. Offering name and group on their own but expecting both is confusing. Maybe like this:

./wendy --name dev:test | jq .
[
  {
    "name": "dev:test",
    "data": {
...
  }
]

And another thing: I don't get the status option. That should be worked out because it seems not to be implemented yet. Or completely taken out.

@lispyclouds
Copy link
Member

Not implemented as in if you mean it looks commented like this:

-- :name get-pipelines :query :many
SELECT p.name, p.image
FROM "pipelines" p
WHERE 1 = 1
--~ (when (not-empty (:pipeline params)) "AND p.name = :pipeline")
/*~ (when (not-empty (:status params)) "
      AND EXISTS (SELECT r.status
		FROM runs r
		WHERE r.pipeline = p.name
 		      AND :status = r.status
		LIMIT 1)")
~*/

it is part of the HugSQL syntax
Was that the question you had?

@lispyclouds
Copy link
Member

maybe we can make the filtering explicit. with --name --group etc.

@TimoKramer
Copy link
Member Author

TimoKramer commented Apr 1, 2020 via email

@TimoKramer
Copy link
Member Author

Closing because it works now.

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

No branches or pull requests

2 participants