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

enable api to handle osc meta -e for attributes #7839

Open
lethliel opened this issue Jul 2, 2019 · 6 comments
Open

enable api to handle osc meta -e for attributes #7839

lethliel opened this issue Jul 2, 2019 · 6 comments
Labels
Feature Frontend Things related to the OBS RoR app

Comments

@lethliel
Copy link
Member

lethliel commented Jul 2, 2019

It is not possible to edit attributes with osc in the way like project meta or package meta can
be edited.

For example:

osc meta -e prj

for the attributes you have to do something like this:

osc meta attribute --attribute 'OSRT:Config' --set 'a very long list'

Describe the solution you'd like
I want the API to be consistent on all meta data

Describe alternatives you've considered
Working the problem around in osc using single POSTs to create each attribute entry.

Additional context
@adrianschroeter suggested to open an issue and fix the API instead.

@hennevogel hennevogel added Feature Frontend Things related to the OBS RoR app labels Jul 2, 2019
@vpereira
Copy link
Contributor

vpereira commented Jul 9, 2019

Does the backend store it as XML? Because I don't see a way via API to get the attributes of a project in one XML i.e dosc api '/sources/$PRJ/_attributes'

@lethliel
Copy link
Member Author

lethliel commented Jul 9, 2019

Yes the backend stores is as one xml

@jberry-suse
Copy link
Contributor

Part of this could be solved by changing the request type from POST to PUT to be consistent. After which I would expect the following to work fine.

osc api -e /source/openSUSE:Leap:15.1:Update/_attribute/OSRT:OriginConfig

Whereas right now the GET works and loads an editor, but saving results in a 404. :/ This is further aggravated by the web interface not properly exposing edit ability to those who are not maintainer, but can edit via API.

@adrianschroeter
Copy link
Member

adrianschroeter commented Jul 16, 2019 via email

@jberry-suse
Copy link
Contributor

we could support PUT in addition, but not replacing the POST functionality, because the POST content can be selected attributes.

It's fine to support both, but it is also a bit squirly to require restating the attribute given it is already required in the the path. I would not expect to be able to POST and update multiple attributes from a path such as /source/<project>/_attribute/<namespace>:<attribute>. From /source/<project>/_attribute perhaps, but not when I already specified a specific attribute.

Supporting PUT would certainly be a step in the right direction.

@adrianschroeter
Copy link
Member

adrianschroeter commented Jul 16, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Frontend Things related to the OBS RoR app
Projects
None yet
Development

No branches or pull requests

5 participants