Rewrite openqa-advanced-retrigger-jobs in python#332
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
Also how about moving scripts to |
An extension would mean that we would need a separate installation tooling and step to install as executable without extension and I would like to avoid that. |
f32c1d5 to
f8d55f9
Compare
Done |
f8d55f9 to
d00d067
Compare
bd97f6e to
bdd1863
Compare
|
Updated:
Tested manually with |
| query = ( | ||
| f"select id from jobs where ({worker_string}result='{args.result}' " | ||
| f"and clone_id is null and t_finished >= '{args.failed_since}'{additional_filters});" | ||
| ) |
There was a problem hiding this comment.
Normally I'd say this needs escaping but of course the previous script also didn't have that…
There was a problem hiding this comment.
I don't know what additional escaping you mean. Why do you mean we need escaping?
There was a problem hiding this comment.
I think he means something in the lines of https://www.psycopg.org/psycopg3/docs/basic/params.html#execute-arguments
Currently e.g. args.result could be used to insert arbitrary SQL statements
There was a problem hiding this comment.
While malice is very unlikely (given you'd need access anyway) it could help if people accidentally pass arguments which cause the query to break
There was a problem hiding this comment.
And one can also (accidentally) break out of the whole psql invocation.
9725eaf to
00ab178
Compare
|
This pull request is now in conflicts. Could you fix it? 🙏 |
|
This pull request is now in conflicts. Could you fix it? 🙏 |
00ab178 to
d4cb020
Compare
d4cb020 to
1a72265
Compare
No description provided.