-
Notifications
You must be signed in to change notification settings - Fork 22
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
multi-apply-tool: first version #302
Conversation
Example use case:
|
Questions:
|
Argh! yes! |
POSIX I think. Might be a GNU-ism. EDIT: apparently it's a bash-ism, although there's some history in other traditional Unixes. |
No objections to these three:
My thought was as they are potentially "destructive", including one more keypress id a bit of a safeguard. Also, the original idea came from modifying the original patchmanager program, where there is
Will do! |
Neither Edit: The |
But then (as currently only
That would make the terms consistent with the ones used at the GUI. Reasoning: "To apply a patch" sure is a standing phrase for users of the |
Idea to unify the options: Make Additional idea: Both suggestion would make PM easily scriptable without resorting to And if you are building a front end for Patchmanager you could also implement the We could even let that script take And another idea: Let |
I hope you like my overhauling it. Sorry, I became (side-) tracked into it. I rather would have posed a PR, but started at the GitHub web-frontend, which does not allow for that. I think I implemented all my suggestions. I plan to review / revisit it in a couple of days. |
Didn't we document somewhere what the allowed character set for (internal) Patch names is? |
Not that I remember, but I guess that's checked in the web catalog code in some way. |
Done, see commit f43e8b6. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please re-review @nephros.
Simulating this by "request changes".
I was unable to find the code which does that at https://github.com/sailfishos-patches/pm-web-catalog. Please check that my checks are not too strict or too relaxed; if anything then rather "too relaxed", because this also checks RPM Patches. But either you or me (or both) should compare this to the Web Catalog, which is more or less a reference. |
Looks good, I can't review my own PR :) |
|
@nephros, the last open point is the one below. Can you please check this? If that results in a need for a change, you are welcome to delegate that to me. Then just drop a pointer to the corresponding check in the Web Catalog's code here.
|
Thanks for the ping. I looked a bit through the catalog code, all I can find are checks for archive files, and the "project name".
so I guess for uploaded archives anything goes that doesn't have something particularly weird as a file name.
|
as per discussion at sailfishos-patches/patchmanager#302 (comment) ff.
I checked the last aspect first, i.e., if there are "subtle differences in what For "yours is more specific than that, but it looks like they should be able to "co-exist" just fine" in point 3: Well, mine is more specific (must start with For the general question, "What are we dealing with there?": To be honest I am a bit confused! Are the Patch names we are dealing with in our script what is called " I assume the answer to all three questions above is "Yes", but I am not sure. Maybe @CODeRUS can enlighten us with a brief statement on this. |
iirc name is the final destination of unpack procedure. if you allow it to have some |
@CODeRUS, thank you very much for your prompt reply.
a. The RegEx I designed does not allow for using " b. As the "name is the final destination of [the] unpack procedure" (AFAICS the "project name", which is validated and this validation is reworked in "[models.py] Improve RegExes", CODeRUS/django-test#8), it is better to also validate the file-name of the uploaded file and additionally the ones in the archive ("Validate file names", CODeRUS/django-test#10). |
can you somehow setup a test server to try all these before it will reach production? :) |
Unfortunately not, I lack the infrastructure and know-how (never did anything with Django). But the logic changes are minimal, just three more I think thoroughly reviewing these two PRs will do, and rather provide a couple of days for that. I will take another close look tomorrow (Sunday) or on Tuesday (and denote when I did that), maybe @nephros can also take a took. Or @nephros, do you have a staging instance of the web-catalog running? |
|
Hm.
Yeah I had it running for a while on a verry unstable and slowly-connected home server. They are offline meanwhile though. But I could provide a testing instance in a pinch. Would an empty one (i.e. one with NO user accounts, no files uploaded etc) suffice, or would it be better to have a clone of the production catalog? |
0. Background / MotivationWhen I analysed in detail which checks for the file-names of uploads to Patchmanager3's web-catalog currently exist (i.e., the archive name and the names of the files in the archive), there was none (except for the one nephros already mentioned, the archive file can be successfully written to the file-system, plus a file named 1. Reviewing the changes to Patchmanager3's web-catalog code by "someone"Task: Review of Python code changes and RegEx changes in the PRs "[models.py] Improve RegExes", CODeRUS/django-test#8 and "Validate file names", CODeRUS/django-test#10. @pherjung, as you mentioned that you have some experience with Python code(ing), and these changes are really small (by amount of changed / added code), may I ask you to review these two PRs? As already discussed and because I try to pull you into reviewing something you have not volunteered for (Patchmanager3's web-catalog), you sure have the freedom to say "No"; unfortunately I have no idea who else I may ask (CODeRUS lacks any time, nephros usually does not code in Python, I have written these changes). To understand and check the motivation and logic behind these changes, start reading at this comment of this thread here up to this message you are currently reading, and the commit comments for the individual commits in the two PRs. Take your time for this review (i.e., this review is not temporally critical), and I would appreciate much, if you help to alleviate CODeRUS' (and to a lesser extent also my) concerns of deploying unreviewed changes in a production environment; no matter how small these changes are, typos (syntax or structural errors) or think'os (logic or reasoning flaws) may have slipped in. Feedback is best provided as comments to these two PRs, maybe except for fundamental think'os, which are better discussed here so nephros can participate. 2. Testing the changes to Patchmanager3's web-catalog by "someone"
Because I solely altered code, which is executed when uploading a Patch to the web-catalog, I think that uploading a few extant Patches with the PRs "[models.py] Improve RegExes", CODeRUS/django-test#8 and "Validate file names", CODeRUS/django-test#10 employed is fully sufficient. If you have an idea how to easily automate uploading of Patches to the web-catalog, then you might clone the production catalog and re-upload all of them to the test instance. As I mentioned to Patrick (pherjung), this is not temporally critical. |
I'll take a look next week. |
Speaking of a test instance, I have a VM running where I can do such job. I can add your SSH public key if you want to access that VM. |
Thank you for the offer, but I deliberately wanted to avoid learning how to install and configure Django and the Web Catalog software, because that would likely cost me some hours, which translates to at least a week in wall time. I also remembered that nephros once had a test instance of the Web Catalog running, but did not know its status and accessibility: As nephros pointed out, he was willing to reactivate it, and the security, bandwidth and maybe also stability limitations are not relevant for testing these additional input filters. Meanwhile I have gained access to it and yesterday we managed to deploy the current master branch plus my two PRs on it. I will now consider how to test effectively and create another PR which overhauls the strings. Still I would appreciate very much, if you thoroughly scrutinise my two PRs by reviewing the changes and their reasoning. While I am quite convinced that these small changes are fine (minus own typos and think'os I might fail to detect), for a good part this is about assuring coderus that it is O.K. to deploy these changes in his production environment (because he lacks the time to test and to quickly react, if there is some fall-out). |
@nephros, ultimately two topics became intermingled here (well, actually I did that): While I hope to return to the latter in the second week of January 2023, IMO this MR can and should be merged now, because it has been ready for months. I also prepared a release of v3.2.3, because we already have accumulated quite some commits, which luckily all look non-critical (and so does this one, thus it fits well), hence this should be an easy release. I was about to hit the "Squash and merge" button in GitHub's web-frontend for this MR, but first wanted align with you(r opinion); also about releasing v3.2.3 when this is merged. |
Agreed, and I have nothing queued for this branch IIRC. Therefore: LGTM, and merging. |
Inspired by #277 (and giving up expanding the dbus-calls in the binary for this), this little tools makes life easier for power users handling large amounts of patches.
Features:
Nothing magic, but useful.
Bugs:
--apply
after an unapply-all without giving a user-specified list will probably error out because patchmanager2.conf has an emptyapplied=
field--apply
without giving a user-specified will just unnnecessarily re-apply the already applied patches