-
Notifications
You must be signed in to change notification settings - Fork 547
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
[upload] Add new component #3894
base: main
Are you sure you want to change the base?
Conversation
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
I finally had a few hours to sit down and work on this abstraction. Opening this draft to show what I'm envisioning for this component. We'll leverage new E.G. I could on a Fedora workstation run Most notably this allows us to onboard new vendors/partners that provide support and use sos, but don't warrant a new policy (e.g. I think the nvidia folks might appreciate this, since they support multiple distros and wrap sos via their The abstraction is fairly straight forward, though I want to highlight two design choices I made in this that we may or may not want to adjust:
I think the hook mechanism has merit as an idea, but beyond username and password credentials I'm not immediately thinking of anything to otherwise prompt for, but perhaps that can come later? At the moment, I've only ported the ftp and sftp upload functions to targets. I'll be porting the other existing ones over the next few days (maybe a week) as time allows. But I also want to hear feedback on the general design if anyone has it. |
92a963e
to
b3f55ab
Compare
Is there any reason why we don't continue the work in the already opened PR #3746 ? You could have added your suggestions there. |
b3f55ab
to
e1fd976
Compare
_do_intro = True | ||
if commons: | ||
_do_intro = False | ||
self.opts = commons['opts'] |
Check warning
Code scanning / CodeQL
Overwriting attribute in super-class or sub-class Warning
SoSComponent
Assignment overwrites attribute opts, which was previously defined in superclass
SoSComponent
I did leave my suggestions that the component needs to have a minimum set of features for implementation. Then when there hadn't been any code changes to the existing PR since August, and the last activity at all on that PR was from October (another review), it appeared to be a basically abandoned PR since there was no communication around ongoing work. Having not seen any progress in that time, I began working out an sos appropriate implementation - which I could iterate over much quicker locally to get a framework in place and begin porting bits to new targets. |
Latest update adds an As of right now, if you were to test this you would need to use |
This commit marks the beginning of a series to implement the upload functionality of collect and report into a separate component. This new upload component is intended to be primarily used to define standard "targets" for uploading support-relevant files to support-providing vendors, e.g. Red Hat and Canonical. Both `report` and `collect` will be made to leverage this component in later commits to this series. As a practical example, the goal for the end-user experience is a command like the following for providing data to a support vendor: + Uploading in-line with report (or collect archive) creation `sos report --case-id 123456 --upload --upload-target=redhat` + Uploading a report after generation `sos upload sosreport-example.tar.xz --target=canonical` + Uploading non-sos data that is relevant to an ongoing support case `sos upload $some_helpful_file --target=my_awesome_vendor` Additionally, there will still be support for "generic" targets such as FTP or SFTP destinations that users may wish to define themselves, and still allow for automatic transfer of generate archives to. This first commit provides the framework for the component directly, as well as the "upload target" abstraction which serves as an entrypoint for standardized destinations for uploads. Signed-off-by: Jake Hunsaker <[email protected]>
Ports the functionality of FTP and SFTP uploading into the new target abstraction. These targets allow users to specify an upload destination using a protocol prefix of eityher `ftp://` or `sftp://` when combined with `--upload-url`. Signed-off-by: Jake Hunsaker <[email protected]>
Adds two new upload targets - a generic http(s) target and a port of the existing ubuntu policy upload to a `canonical` upload target. Note that this also changes the `upload-method` option to `--upload-http-method` and also removes `auto` as a valid choice, leaving just `put` and `post`, as it is assumed that the `auto` logic would now be redundant for independently implemented vendor targets that subclass the generic http target. Signed-off-by: Jake Hunsaker <[email protected]>
e1fd976
to
9b00667
Compare
And you didn't think of reaching out and, you know, ask? Instead you decided to do your thing alone. Again. |
I dont understand this duplicit activity. Usually, we ask if a PR is abandoned or if we can expect some progress from its author, rather than writing own (draft) version of the same PR. Things were going slowly on the Jose's PR, that is correct, but.. I would expect a different approach in upstream collaboration than raising a competing draft proposal without prior notice. I am off today so I cant assess this PR or compare it to Jose's one today. But I did review of Jose's current version of PR very recently and it seemed to me worth accepting. |
This project is not your keeper and if you want to contribute to it, then you are responsible for keeping up with your submissions. Months without movement is on no one but you and neither I nor this project am going to be held to your arbitrary schedules. You don't see us pinging other authors outside of a single effort to align labeling, what makes you special here? We have routinely posted replacement PRs when others are stale. What makes you special here? But let's take this a step further. I have repeatedly said over the last ~2 months that I was trying to find time to work on an upload component. In public, on threads that you were apart of. "You didn't think of reaching out and, you know, ask" about that? Not a single "hey, Jake, I'm still working on this and should have something up in $days/$weeks/whatever". Pot, meet kettle.
Excellent strawman, really. This PR was opened as a draft to show and solicit feedback on the proposed framework of a lighter-weight, more extensible, and easier to maintain design than what is currently implemented today, and by extension of 3746 being a copy-and-move of existing code, that PR. Or, as most people would call it, this PR is stock FOSS development. SoS is an open source project and contributions are welcome and desired from all interested parties, but that doesn't mean that we coalesce on the first proposal. FOSS, by nature, moves forward with improved ideas and designs, not just anything and everything that gets thrown together and happens to function. No one - not myself, nor anyone else who has, does, or will contribute to this project - owes you, me, or anyone else deference to open PRs when they believe they can provide a better solution. If you think you have a better design for a PR I have open, by all means please post it.
Once again an astounding strawman, and quite bluntly a great example of why I not only started working towards this component, but also why #3887 is where it's at. Nobody here owes you anything. You do not get to claim work at the exclusion of others. There have been over 300 contributors to this project, and they all have brought code that not only goes through review and requests for changes, but have also been rejected due to one reason or another and from those rejections they have made timely efforts to rectify and listen to reviewer feedback. The goal of this project is to provide a high quality, easy to use end-user experience when performing troubleshooting and we don't get there without adhereing to certain standards. 300 other people have made changes to other's code and had their own code changed in turn. This is not some vanity exercise it is pursuit of better code. 300 other people have understood this, accepted this, and worked with us to improve the utility. 300 other people have understood that this project at its core is no different than any other FOSS project. I invite you to be one of those people going forward. |
Nothing makes me special, and I never claimed so. But yes, both @arif-ali and I pinged contributors to ask what was happening with old issues and PRs.
Where have you said this? I said in IRC a couple of times that I was working on this and aiming to push some changes, and then internal things delayed.
Yeah, but hey, the difference is that you knew I was working on the PR (why would you assume I abandoned it?), and I didn't know you decided to do so. Even though you claim you did, I don't know where.
Again, I never said anybody owes me anything. I would have loved to work on this together. I respected your suggestions, and would have followed all of them completely, like I've done every time. By nature, this is a collaborative process, and for that we need to work improving each other's work, for sure, but not ignoring or competing, the efficiency of the project suffers then.
I'm not claiming work at the exclusion of others, I'm claiming that we should coordinate to avoid repeating work. Other contributors provide feedback, and PR owners take it or leave it. And we work together. If there is a major issue with a PR, then this should be brought to the attention of those working on it, but to simply start working in parallel defeats the purpose of actually being a team.
Yes, and I'm the #4 on the list, so I know quite well how to work within this project.
I'm sorry but I'm not entirely sure your actions reflect this idea. This is supposed to be a team effort, but when this is brought up you start assigning intentions and negative connotations to requests for better communication.
I've worked with them as well. But don't let that be in the way of claiming that I'm asking for special treatment, or that I don't understand FOSS projects, or any other thing that you want to claim to attack my personality and approach to the project, instead of making an effort to work as part of a team. |
Where have you said your interest in writing an upload component, please? I dont recall it (but I could forget it / misunderstood / skipped that conversation) and I cant find it either in mail notifications or in in search here (https://github.com/search?q=repo%3Asosreport%2Fsos+upload+component&type=pullrequests).
So Jake's and Jose's work can be merged, at the end? Jake working on class hierarchy, Jose on the code changes below (very roughly saying)? (I have to review this PR proposal, just trying to get the idea / target / circumstances). I am asking this way since I see Jose's PR in quite good shape, lot of work done there, so no big reason to throw it away. I.e. we can merge Jose's work (once suggested changes resolved) to have the upload subcommand working, and meantime agree on the class hiearchy changes within this PR..? |
I will reserve my comments on the issues in a private matter and don't plan to add anything public. But based on the conversations, it makes sense to collaborate on the efforts so that work done is not wasted on either side and the end goal is accomplished and that is getting a good feature out there. Based on what I am seeing on the PRs, and I haven't reviewed heavily (I need some time), the 2 PRs have one idea of creating a new component for |
I havent reviewed this draft PR yet (I should do tomorrow), but I guess default value of |
I'll reserve other comments pending our maintainer call, but for this specifically - yes, |
Users should only upload data using this utility to locations that are both \ | ||
well-known and trusted by them and/or their organizations. This utility does \ | ||
not accept any responsibility for the safety, security, or handling of any \ | ||
data transmitted with it to any location.\n\ |
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.
Useful banner.
1. The setting of `--upload-user` and `--upload-pass` in either the | ||
commandline execution of sos or a given config file. | ||
2. The setting of the SOSUPLOADUSER and SOSUPLOADPASS env vars | ||
3. A prompt for user input, iff the target has set the | ||
`prompt_for_credentials` class var to `True`. This prompt will be | ||
skipped if `--batch` is set. |
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.
Current ordering is 2., then 1., then 3., due to:
def get_upload_user(self):
"""Helper function to determine if we should use the policy default
upload user or one provided by the user
:returns: The username to use for upload
:rtype: ``str``
"""
return (os.getenv('SOSUPLOADUSER', None) or
self.upload_user or
self._upload_user)
method, am I right? Why the change?
(on one side, cmdline option should override more-generic env.variable that is more "persistent", but config file is yet "more persistent" than env.variable; also when user sets both env.var and cmdline option, we should prefer the value that is obfuscated (in process list))
Is target more likely protocol, or policy, or both? How the class hierarchy can handle Red Hat policy "ambiguity" in providing two different protocols (ftp and http), with automatic failover from http to ftp? |
Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines