[opensuse-buildservice] OBS design error?
Hi, While working with OBS, I've noticed that all the meta data configuring the projects and packages is stored only on the server, and is treated with special commands. This has the disadvantages of making it harder for users to backup their projects locally. It is a key piece of information that does not follow the source code and spec files. It would be really useful if this information were at least cached in the .osc subdirectories somewhere, in my opinion. Just thought I'd mention it. - Chris --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Wednesday 30 July 2008 23:28:20 Chris Frey wrote:
Hi,
While working with OBS, I've noticed that all the meta data configuring the projects and packages is stored only on the server, and is treated with special commands.
This has the disadvantages of making it harder for users to backup their projects locally. It is a key piece of information that does not follow the source code and spec files.
It would be really useful if this information were at least cached in the .osc subdirectories somewhere, in my opinion.
You may want to request this as a feature for osc via bugzilla. -- Adrian Schroeter SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) email: adrian@suse.de --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On 2008-07-30 17:28:20 -0400, Chris Frey wrote:
Hi,
While working with OBS, I've noticed that all the meta data configuring the projects and packages is stored only on the server, and is treated with special commands.
This has the disadvantages of making it harder for users to backup their projects locally. It is a key piece of information that does not follow the source code and spec files.
It would be really useful if this information were at least cached in the .osc subdirectories somewhere, in my opinion.
osc already stores the package meta in the .osc/_meta file. It might make sense to do the same for the project meta. Or are you talking about something else? Marcus --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Thu, Jul 31, 2008 at 03:53:38PM +0200, Marcus H?we wrote:
osc already stores the package meta in the .osc/_meta file. It might make sense to do the same for the project meta. Or are you talking about something else?
Yes, that's exactly what I was looking for. :-) I didn't realize it was partly implemented already, as I was on version 104, so I grabbed the latest SVN, and copied the pac implementation to update prj too. Here's the patch. I hope someone can review it and possibly commit it. Thanks, - Chris Index: osc/core.py =================================================================== --- osc/core.py (revision 4585) +++ osc/core.py (working copy) @@ -282,6 +282,7 @@ checkout_package(self.apiurl, self.name, pac, \ pathname=getTransActPath(os.path.join(self.dir, pac)), \ prj_obj=self, prj_dir=self.dir) + self.update_local_prjmeta() def set_state(self, pac, state): node = self.get_package_node(pac) @@ -388,6 +389,16 @@ else: print 'unsupported state' + def update_local_prjmeta(self): + """ + Update the local project _meta file in the store. + It is replaced with the version pulled from upstream. + """ + meta = ''.join(show_project_meta(self.apiurl, self.name)) + f = open(os.path.join(self.absdir, store, '_meta'), 'w') + f.write(meta) + f.close() + def update(self, pacs = (), expand_link=False, unexpand_link=False): if len(pacs): for pac in pacs: @@ -451,6 +462,7 @@ self.checkout_missing_pacs() finally: self.write_packages() + self.update_local_prjmeta() def commit(self, pacs = (), msg = '', files = {}): if len(pacs): --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On 2008-07-31 22:55:12 -0400, Chris Frey wrote:
On Thu, Jul 31, 2008 at 03:53:38PM +0200, Marcus H?we wrote:
osc already stores the package meta in the .osc/_meta file. It might make sense to do the same for the project meta. Or are you talking about something else?
Yes, that's exactly what I was looking for. :-) I didn't realize it was partly implemented already, as I was on version 104, so I grabbed the latest SVN, and copied the pac implementation to update prj too.
Here's the patch. I hope someone can review it and possibly commit it.
Your patch looks good but before I commit it I've a general question:) Why do you want to store the metadata in the .osc/ dir? If you want to have a backup of your metadata simply run "osc meta prj <project>" after you modified your project's metadata. In case we store it in the osc dir you have to check your metadata all the time before you run "osc up" otherwise it'll be replaced with the new version. Marcus --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Sun, Aug 03, 2008 at 09:49:55PM +0200, Marcus H?we wrote:
Your patch looks good but before I commit it I've a general question:) Why do you want to store the metadata in the .osc/ dir? If you want to have a backup of your metadata simply run "osc meta prj <project>" after you modified your project's metadata. In case we store it in the osc dir you have to check your metadata all the time before you run "osc up" otherwise it'll be replaced with the new version.
Hi Marcus, Well, my reasoning was in the first email, where I considered it a design error that there was some project data that was "out-of-band" in the sense that it was not enough to checkout a project, back it up, and have everything you need to recreate it if needed. I think ideally, this meta data should just be files that you check in with osc commit, just like every other file. (Similar to how _link is handled.) This would provide history, and an extremely visible way of storing this data. I don't know how the meta data is stored in the backend, and maybe using files like that would make things harder for other clients, such as the webclient. So as a workaround, I wrote this patch, since it was already half way there. Someone else had already implemented it for packages, I just added it for projects as well. I only meant it as a cache of what is on the server. It's not an ideal patch, since the cached version should also be updated when the user edits it, but it's a start. I'd still prefer to see config data stored as files, though, and would happily see my patch dropped if movement was made in the files direction. Thanks, - Chris --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On 2008-08-04 22:30:00 -0400, Chris Frey wrote: <SNIP>
I don't know how the meta data is stored in the backend, and maybe using files like that would make things harder for other clients, such as the webclient.
Well in fact it is stored as a file but for this "special" file there's no history (so you can't lookup who modified the metadata etc.). But you're able to read/write the metadata (for example you can use https://api.opensuse.org/source/<project>/_meta to modify the project's metadata).
So as a workaround, I wrote this patch, since it was already half way there. Someone else had already implemented it for packages, I just added it for projects as well. I only meant it as a cache of what is on the server.
It's not an ideal patch, since the cached version should also be updated when the user edits it, but it's a start.
This is not possible - for instance in osc's case you can modify the metadata even if you don't have a working copy of a project/package.
I'd still prefer to see config data stored as files, though, and would happily see my patch dropped if movement was made in the files direction.
Marcus --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
participants (3)
-
Adrian Schröter
-
Chris Frey
-
Marcus Hüwe