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

Promoting builds does not pass parameters #20

Open
lennym opened this issue Aug 25, 2020 · 4 comments
Open

Promoting builds does not pass parameters #20

lennym opened this issue Aug 25, 2020 · 4 comments

Comments

@lennym
Copy link

lennym commented Aug 25, 2020

If I use the client.promoteBuild method with parameters then these are not available when the build executes.

It appears the root cause of this is that code at https://github.com/drone/drone-node/blob/master/lib/index.js#L331-L339 passes the parameters as part of the POST body, but the server expects them in the querystring (based on my reading of https://docs.drone.io/api/builds/build_promote/)

I tried making the same requests with curl to validate this and if the params are sent in the query string then they appear correctly.

I would make this change myself since it should be fairly simple, but I don't know the API well enough to know which other methods are affected (I suspect there may be several).

@lennym
Copy link
Author

lennym commented Aug 25, 2020

I have created a small - but probably incomplete - pull request at #21

@tboerger
Copy link
Contributor

Are you sure about that? Not sure if I tested parameters, but I'm pretty sure the promote/rollback was only working like I built it.

@lennym
Copy link
Author

lennym commented Aug 28, 2020

I published a forked version which I've been using for our real-world deployments, so fairly sure.

It's also consistent with the documentation I linked above which instructs to pass parameters via query string.

@lennym
Copy link
Author

lennym commented Aug 28, 2020

For what it's worth, I think passing build parameters in the request body would be far better given their likelihood to contain sensitive data.

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