-
Notifications
You must be signed in to change notification settings - Fork 125
Add plugin for Open Build Service (OBS) #2541
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
base: main
Are you sure you want to change the base?
Conversation
|
This works around openSUSE/open-build-service#3153 by doing the HTML parsing (as mentioned in the descripion). |
Conan-Kudo
left a comment
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.
This is a great start (though scraping the web page is gross, it is the only way for now...), this is just a first glance of things to fix.
| #include <libdnf5/utils/bgettext/bgettext-mark-domain.h> | ||
|
|
||
| static const char * const OBS_COMMAND_DESCRIPTION = | ||
| _("Manage Obs repositories (add-ons provided by users/community/third-party)"); |
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 consistently use OBS or Open Build Service, and not Obs.
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.
updated, i think i got all of them but please let me know if i missed any
| _("Enabling a Obs repository. Please note that this repository is not part\n" | ||
| "of the main distribution, and quality may vary.\n" | ||
| "\n" | ||
| "The Fedora Project does not exercise any power over the contents of\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.
Since the default is actually the openSUSE Build Service, this needs to be "The openSUSE Project"
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.
updated
| "this repository, and packages are not held to any quality or security\n" | ||
| "level.\n" | ||
| "\n" | ||
| "Please do not file bug reports about these packages in Fedora\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.
Fedora->openSUSE.
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.
updated
| "the main Obs repository (they provide runtime dependencies).\n" | ||
| "\n" | ||
| "Be aware that the note about quality and bug-reporting\n" | ||
| "above applies here too, Fedora Project doesn't control the\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.
Fedora Project -> the openSUSE Project
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.
updated
|
per above comments, changed all 'Obs' -> 'OBS' in comments and strings, as well as 'Fedora' -> 'openSUSE' in strings |
|
another update to remove and adjust some code comments |
|
update to remove |
|
Technically OBS repos could, but it's hard to identify them and it's better off not worrying about it. |
This is similar to the COPR plugin, but for the OBS service. Fixes: rpm-software-management#2540
|
updated the pot file |
|
Wouldn't it make sense to also add a key like It's largely formulaic after you get to the |
|
And we can assume the default for systems that we don't have this defined to be |
good point, i'll add that in. with that (and the hostname:82 default) we can probably skip the html parsing completely, or at least move it to a fallback attempt. |
|
Yeah, that should be last-resort code. |
|
I'm glad you find DNF5 attractive to write new plugins for it. But this code looks more focused on Open Build Service than on DNF5. I.e. I foresee future changes in this code because of OBS rather than because of DNF5. Also testing this plugin will be probably tightly coupled to real OBS which DNF5 project cannot provide. In my opinion, this plugin should be maintained in a separate repository. (I have the same opinion about a COPR plugin.) At the end, that's the point of plugins, to be maintained separately. It would be also healthy for the DNF5 project because it will forced DNF5 to maintain API/ABI properly. |
This adds a 'obs' plugin to allow adding repos provided by the Open Build Service (OBS), i.e. https://build.opensuse.org/
The user interface is very similar to the COPR plugin; the same commands are provided (enable, disable, remove, list, debug). The main difference is the format of the repository "id":
[HUB/]OWNER/PROJECT [CHROOT][HUB/]PROJECT/REPONAMEThe
HUBpart is the same for both of them, i.e. the hostname (or shortname) of the webui/api of the service; if not specified the default (build.opensuse.org) is used, just like the COPR plugin.The COPR repos will always have a
OWNERthat owns a specificPROJECT, and the OBS repos will also have some kind ofOWNER, but the field doesn't have any fixed format; it can be "home:user" or "system:systemd" or other formats. The OBS repos also can have any number of levels ofPROJECT, including none at all (e.g. "home:user" can have a repo, "home:user:subproject1" can have a repo also, "home:user:subproject1:subsubproject2" can also, etc.). It makes more sense, to me at least, to simply roll theOWNERandPROJECT(s) together as a singlePROJECT(with each level delimited by colons; and this is how OBS presents it to users).The OBS plugin also differs from COPR by including the actual repo name as the
REPONAMEin the id. The repo name roughly corresponds to the COPR "chroot" (e.g. "fedora-rawhide-ppc64le"), but the repo isn't arch-specific (technically it is, but OBS repos aren't separated by arch like COPR repos are, so most repos have multiple archs enabled), and the repo name isn't guessable based on the local system. Users can name their repos whatever they want.One other note; when the plugin is provided a repo spec (i.e.
PROJECT/REPONAME), it forms a URL to the OBS repo's "repository state" HTML web page, and downloads it, and then parses it (using libxml2 HTML parsing) to extract the HREF to the repo download URL. I don't think this is ideal, but it's required because of 2 reasons:Finally, this of course doesn't have any translations for the plugin, although I did add a .pot file.
Fixes: #2540