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

Route PUT /source/<project>/<package>/<filename> has the wrong schema documented #9706

Open
dcermak opened this issue Jun 9, 2020 · 9 comments
Labels
API Things regarding our API Bug Documentation 📖 Things regarding our documentation Frontend Things related to the OBS RoR app

Comments

@dcermak
Copy link
Contributor

dcermak commented Jun 9, 2020

Issue Description

The route PUT /source/<project>/<package>/<filename> is returning a result.xsd according to the documentation. This is however not true when invoking it directly via curl --user ${CREDENTIALS} -X PUT ${OBS}/source/${project}/${package}/${filename} -d "", which returns a revision.

Expected Result

Either the route should return a status or the documentation should state that it returns a revision.

How to Reproduce

  1. Create a dummy package
  2. Run:
$ curl --user ${CREDENTIALS} -X PUT ${OBS}/source/${project}/${package}/${filename} -d ""
<revision rev="1" vrev="1">
  <srcmd5>12f1ca68b9ac8cbd5767771391aaa445</srcmd5>
  <version>unknown</version>
  <time>1591707122</time>
  <user>Admin</user>
  <comment></comment>
  <requestid/>
</revision>

Further Information

  • Tested on OBS 2.10.5
@dcermak
Copy link
Contributor Author

dcermak commented Jun 9, 2020

Yet another inconsistency: if you instead use curl --user ${CREDENTIALS} -X PUT ${OBS}/source/${project}/${package}/${filename}?rev=repository -d "something in here" then you will get neither a status nor a revision back, but this:

<revision rev="repository">
  <srcmd5>d41d8cd98f00b204e9800998ecf8427e</srcmd5>
</revision>

This does look like a revision, but does not adhere to the schema as defined in revisionlist.rng as the elements version, time and user are not optional.

@mlschroe
Copy link
Member

mlschroe commented Jun 9, 2020

Repository only uploads (rev=repository) do not create a revision at all, so you only get the srcmd5 back.

@dcermak
Copy link
Contributor Author

dcermak commented Jun 9, 2020

Repository only uploads (rev=repository) do not create a revision at all, so you only get the srcmd5 back.

That makes sense, but of which object do I get the md5 hash? I've tried to figure it out on a local OBS test instance, but have failed so far.

(And the documentation should still explain that imho)

@mlschroe
Copy link
Member

mlschroe commented Jun 9, 2020

I don't understand that. You can use the returned srcmd5 hash as revision if you want to access your files. (i.e. rev=d41d8cd98f00b204e9800998ecf8427e in your example)

@dcermak
Copy link
Contributor Author

dcermak commented Jun 9, 2020

Let me rephrase that: is the returned srcmd5 the hash of the file that I just uploaded or the package in the new "dirty" state or of the package in the state without the modifications or something entirely different?

@mlschroe
Copy link
Member

mlschroe commented Jun 9, 2020

The returned srcmd5 is a representation of the complete file set. Git calls those "tree" objects.

@dcermak
Copy link
Contributor Author

dcermak commented Jun 9, 2020 via email

@marcus-h
Copy link
Member

marcus-h commented Jun 9, 2020 via email

@dcermak
Copy link
Contributor Author

dcermak commented Jun 10, 2020 via email

@danidoni danidoni added the Frontend Things related to the OBS RoR app label Jun 11, 2020
@hellcp-work hellcp-work added Bug Documentation 📖 Things regarding our documentation API Things regarding our API labels Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Things regarding our API Bug Documentation 📖 Things regarding our documentation Frontend Things related to the OBS RoR app
Projects
None yet
Development

No branches or pull requests

5 participants