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

Provide a backup functionality for project and package meta information via osc #1484

Open
lrupp opened this issue Feb 13, 2024 · 1 comment
Labels

Comments

@lrupp
Copy link
Member

lrupp commented Feb 13, 2024

Is your feature request related to a problem? Please describe.

  • If someone (accidentally) deletes an OBS project (osc rdelete -f foo), it would be nice to have a backup of all meta information available
  • If someone wants to migrate a project (or package?) from one OBS instance to another (thinking about OBS and PackageHub for example), if would be nice to have an easy way to "download all the needed data".
  • If someone wants to get an idea about available meta configuration files (like _attribute, _prj, _prjconf, ...), if would be nice, if there is a possibility to use a huge project like 'openSUSE:Factory' to download a local copy of all available files for an analysis of them.

Describe the solution you'd like

I'm currently thinking about a new osc command like: osc backup $project or osc backup $project $package

As result, I would expect (for example) a new directory inside my project folder, which contains all the "meta data files", that form the meta data of a project.

Here is an example idea of such a folder structure, with the $project folder as base - and a newly created _osc_metadata_backup directory, containing the various configuration snipplets as XML dumps:

$project
        |- _osc_metadata_backup
                      |- attribute
                      |- pattern
                      |- prjconf
                      |- prj
        |- package1
                      |- _osc_metadata_backup
                                      |- pkg
        |- package2

Describe alternatives you've considered

At the moment, a user has to do a lot of manual steps to gather all relevant metadata for a package/project. Something like (pseudo):

cd "$projectdir"
mkdir -p _osc_metadata_backup
for metafile in attribute prj prjconf pattern; do
    osc meta $metafile > "$projectdir/_osc_metadata_backup/${metafile}"
done
for package in $(ls -d *); do 
  cd "$package"
 mkdir -p _osc_metadata_backup
 for metafile in pkg ; do
   osc meta $metafile > "_osc_metadata_backup/${metafile}"
 done
 cd ..

It's also easy to forget metadata, if the team decides to introduce something new (for - as example - better container or product handling) in the future. Having the list of possible "meta files" maintained in osc - and being able to dump them into a specific folder might help.
Maybe (I simply don't know) it is already possible to request a list of possible meta data files/information from OBS directly?

@lrupp lrupp added the Feature label Feb 13, 2024
@hennevogel
Copy link
Member

JFYI:

If someone (accidentally) deletes an OBS project (osc rdelete -f foo), it would be nice to have a backup of all meta information available

No project/package is ever really deleted and everything can be undeleted.

If someone wants to migrate a project (or package?) from one OBS instance to another (thinking about OBS and PackageHub for example), if would be nice to have an easy way to "download all the needed data".

You can also copy entire projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants