Univention Bugzilla – Bug 42060
App Center Self Service: Dev-Tools
Last modified: 2017-11-16 14:24:01 CET
(In reply to Dirk Wiesenthal from comment #9) > You are right, there needs to be a Non-UCS-script at some point in time. > > I thought it would be good if first, the functionality is checked. In a > second step I would create a separate script. > > Anyway, now the script is here: > > https://selfservice.software-univention.de/appcenter-selfservice/univention- > appcenter-selfservice > > It is Python (because I really do not want to do argument parsing, response > parsing, error messages in bash). And it is somehow based on univention-app. > This does all the argparse / subparser stuff for me plus some subprocessing > and logging. > > Also, I tested all of it with univention-app. > > As it had to be UCS independent, I copied _a lot_ of code from > univention-appcenter, making the script ~600 lines long. This new script is in which source package? Is this the correct way to run the script? -> curl -sSlf https://selfservice.software-univention.de/appcenter-selfservice/univention-appcenter-selfservice| python - status --username fbotner --pwdfile /tmp/a dudle Is the download action broken? -> curl -sSlf https://selfservice.software-univention.de/appcenter-selfservice/univention-appcenter-selfservice| python - download --username fbotner --pwdfile /tmp/a 4.1 dudle Curling https://selfservice.software-univention.de/univention-management-console/auth Curling https://selfservice.software-univention.de/univention-management-console/command/appcenter-selfservice/api Curling https://selfservice.software-univention.de/univention-management-console/command/appcenter-selfservice/download_archive Unrecoverable result: {u'status': 422, u'message': u'Eine Option f\xfcr download_archive hat den falschen Typ: 1 Fehler aufgetreten', u'result': {u'app': u'Component dudle does not exist'}}
Currently, this is not Part of any package. I can copy it to self-service. Download works on component_ids not app_ids.
(In reply to Dirk Wiesenthal from comment #1) > Currently, this is not Part of any package. I can copy it to self-service. yes > Download works on component_ids not app_ids. ah, ok please add a action to contact univention
curl -sSfL https://selfservice.software-univention.de/appcenter-selfservice/univention-appcenter-selfservice + python - -h --username=fbotner --pwdfile /home/fbotner/.selfservicepwd usage: - - is a program to use the Univention App Center Self Service help message looks a bit weired, i guess this "usage = '%(prog)s'" does not work if the script comes from stdin
Piping it via curl is not the way I had in mind. You can download it somewhere and use it multiple times (as you may want to add a new Version, upload something, contact Univention. There is a Check whether the script is up to date when being used. The Client compares its API_VERSION with one fetched from the server.
very cool, i think this script helps a lot maybe we need something like update_latest_test_app, or get_latest_test_component, otherwise one has to figure out the name of the component before updating the test app (selfservice status horde, grep output to get component name, selfservice upload 4.1 horde_20160819115028 horde_20160819115028.tar.gz) (In reply to Dirk Wiesenthal from comment #4) > Piping it via curl is not the way I had in mind. why not, i like that > > You can download it somewhere and use it multiple times (as you may want to > add a new Version, upload something, contact Univention. > > There is a Check whether the script is up to date when being used. The > Client compares its API_VERSION with one fetched from the server.
Help message: upload Uploads an App to the Univention Test App Center Shouldn't that say "Uploads an App to the App Center Self Service"
please add something like update-packages version component - Uploads packages to an App ...
if i run the script on dimma, i get the following error python /tmp/sl status horde + python /tmp/sl status horde Traceback (most recent call last): File "/tmp/sl", line 152, in <module> class UniventionAppAction(object): File "/tmp/sl", line 155, in UniventionAppAction parent_logger = get_base_logger().getChild('actions') AttributeError: Logger instance has no attribute 'getChild'
(In reply to Felix Botner from comment #8) > if i run the script on dimma, i get the following error > > python /tmp/sl status horde > + python /tmp/sl status horde > Traceback (most recent call last): > File "/tmp/sl", line 152, in <module> > class UniventionAppAction(object): > File "/tmp/sl", line 155, in UniventionAppAction > parent_logger = get_base_logger().getChild('actions') > AttributeError: Logger instance has no attribute 'getChild' Do we really need this logger stuff in the self service script? Logging is done on the server (at least i hope so) and on the client it is enough to print error to stderr.
(In reply to Felix Botner from comment #2) > (In reply to Dirk Wiesenthal from comment #1) > > Currently, this is not Part of any package. I can copy it to self-service. > > yes > Done > > Download works on component_ids not app_ids. > > ah, ok > > please add a action to contact univention I have not done this yet. Is this really needed for the script? This is basically writing a mail to appcenter@univention.de. Contacting Univention (especially that we shall publish the App) should be done after manual testing. (In reply to Felix Botner from comment #3) > curl -sSfL > https://selfservice.software-univention.de/appcenter-selfservice/univention- > appcenter-selfservice > + python - -h --username=fbotner --pwdfile /home/fbotner/.selfservicepwd > usage: - > > - is a program to use the Univention App Center Self Service > > help message looks a bit weired, i guess this "usage = '%(prog)s'" does not > work if the script comes from stdin Okay, done (I think) (In reply to Felix Botner from comment #6) > Help message: > upload Uploads an App to the Univention Test App Center > > > Shouldn't that say "Uploads an App to the App Center Self Service" Okay, done (In reply to Felix Botner from comment #7) > please add something like > > update-packages version component - Uploads packages to an App ... This is %(prog)s upload *.deb (In reply to Felix Botner from comment #8) > if i run the script on dimma, i get the following error > > python /tmp/sl status horde > + python /tmp/sl status horde > Traceback (most recent call last): > File "/tmp/sl", line 152, in <module> > class UniventionAppAction(object): > File "/tmp/sl", line 155, in UniventionAppAction > parent_logger = get_base_logger().getChild('actions') > AttributeError: Logger instance has no attribute 'getChild' This is because you piped it. dimma has python2.6 installed while the script shebangs to python2.7. I do not know how many ISVs will use an outdated Python version AND pipe the script. The logging is not super important, but some features would need to be dropped / implemented. (e.g. red warning messages). But anyway, I cannot guarantee to stay python2.6 compatible after this workaround. TODO: Get latest component ID. Would you call this a blocker? Currently there is no such method on the server side. I would have to "grep" the component in the script (while still fetching everything!) or add this method to UMC just for this script.
(In reply to Dirk Wiesenthal from comment #10) > I have not done this yet. Is this really needed for the script? This is > basically writing a mail to appcenter@univention.de. Contacting Univention > (especially that we shall publish the App) should be done after manual > testing. Some ISV's have scripts to test the app and sending an email to the appcenter. It would be nice to have such a feature in the selfservice script because then one don't need to setup the email infrastructure on the test system for sending this email and we are sure that the From address is correct (because it is set in the selfservice module). -> but not important >> AttributeError: Logger instance has no attribute 'getChild' > This is because you piped it. No, this is because python2.6 > dimma has python2.6 installed while the script > shebangs to python2.7. I do not know how many ISVs will use an outdated > Python version AND pipe the script. i know at least one, Univention > The logging is not super important, but > some features would need to be dropped / implemented. (e.g. red warning > messages). But anyway, I cannot guarantee to stay python2.6 compatible after > this workaround. Lets say i want to change packages for an app. I build the packages on the buildsystem and want to directly upload them to the selfservice. At the moment i have to copy the package to another system, a system that supports univention-appcenter-selfservice. But OK, i see the point, we can't support all python versions. -> But at least check sys.version_info and abort the execution with an appropriate error message if the script is executed with the wrong python version.
*** This bug has been marked as a duplicate of bug 42917 ***
(In reply to Dirk Wiesenthal from comment #12) > > *** This bug has been marked as a duplicate of bug 42917 *** hmm, ok then
Nothing to release