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 utility to print the list of devel projects for a given project. #628

Merged
merged 1 commit into from Jan 11, 2017

Conversation

@jberry-suse
Copy link
Contributor

jberry-suse commented Jan 6, 2017

Simotek in #opensuse-factory was looking for a list of devel projects for Factory. I figured this could be handy and the code already exists in osc-check_source.py. Perhaps this is not the right place, but if so here it is.

@coveralls

This comment has been minimized.

Copy link

coveralls commented Jan 6, 2017

Coverage Status

Coverage remained the same at 44.331% when pulling e59e598 on jberry-suse:devel-project-list into 72d99f6 on openSUSE:master.

@lnussel

This comment has been minimized.

Copy link
Member

lnussel commented Jan 9, 2017

could we maybe run this regularly and upload the result e.g. to the dashboard container? That would allow other scripts like "staging list" to fetch the information. The call sometimes takes 10 minutes and is a constant source of annoyance for me :-)

@jberry-suse

This comment has been minimized.

Copy link
Contributor Author

jberry-suse commented Jan 9, 2017

Yeah, this is also one of the calls I cache in #625 which alleviates 99% of time cost. I figured it might be handy to dump somewhere public since it is a requirement of sorts to get a package accepted into a devel project before factory, but I am not aware of an up-to-date list.

@jberry-suse

This comment has been minimized.

Copy link
Contributor Author

jberry-suse commented Jan 10, 2017

I went ahead and added a --write option to do just that. Assuming this is the desired location and implementation then I'd suggest accepting this, enable automatic running, ensure working properly, and then swap out existing calls to look at this file.

https://build.opensuse.org/package/view_file/openSUSE:Factory:Staging/dashboard/devel_projects?expand=1

diff --git a/devel-project-list.py b/devel-project-list.py
index 206fb63..cc5c288 100755
--- a/devel-project-list.py
+++ b/devel-project-list.py
@@ -6,6 +6,8 @@ from xml.etree import cElementTree as ET
 
 import osc.conf
 import osc.core
+from osclib.conf import Config
+from osclib.stagingapi import StagingAPI
 
 
 def devel_projects_get(apiurl, project):
@@ -29,12 +31,18 @@ def devel_projects_get(apiurl, project):
 def main(args):
     osc.conf.get_config(override_apiurl=args.apiurl)
     osc.conf.config['debug'] = args.debug
+    Config(args.project)
 
     devel_projects = devel_projects_get(osc.conf.config['apiurl'], args.project)
     if len(devel_projects) == 0:
         print('no devel projects found')
     else:
-        print('\n'.join(devel_projects))
+        out = '\n'.join(devel_projects)
+        print(out)
+
+        if args.write:
+            api = StagingAPI(osc.conf.config['apiurl'], args.project)
+            api.save_file_content('%s:Staging' % api.project, 'dashboard', 'devel_projects', out)
 
 
 if __name__ == '__main__':
@@ -43,6 +51,7 @@ if __name__ == '__main__':
     parser.add_argument('-A', '--apiurl', metavar='URL', help='API URL')
     parser.add_argument('-d', '--debug', action='store_true', help='print info useful for debuging')
     parser.add_argument('-p', '--project', default='openSUSE:Factory', metavar='PROJECT', help='project for which to list devel projects')
+    parser.add_argument('-w', '--write', action='store_true', help='write to dashboard container package')
     args = parser.parse_args()
 
     sys.exit(main(args))

Could also make this part of osc-staging, but not sure that is desired.

@jberry-suse jberry-suse force-pushed the jberry-suse:devel-project-list branch from e59e598 to 47b8086 Jan 10, 2017
@coveralls

This comment has been minimized.

Copy link

coveralls commented Jan 10, 2017

Coverage Status

Coverage remained the same at 44.331% when pulling 47b8086 on jberry-suse:devel-project-list into 55ae250 on openSUSE:master.

@jberry-suse

This comment has been minimized.

Copy link
Contributor Author

jberry-suse commented Jan 10, 2017

Presumably this list can be linked to from a relevant wiki page so folks know what projects to target for getting into Factory.

@jberry-suse jberry-suse force-pushed the jberry-suse:devel-project-list branch from 47b8086 to 609a11c Jan 10, 2017
@coveralls

This comment has been minimized.

Copy link

coveralls commented Jan 10, 2017

Coverage Status

Coverage remained the same at 44.331% when pulling 609a11c on jberry-suse:devel-project-list into 55ae250 on openSUSE:master.

@lnussel lnussel merged commit 7503c17 into openSUSE:master Jan 11, 2017
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jberry-suse

This comment has been minimized.

Copy link
Contributor Author

jberry-suse commented Jan 11, 2017

What needs to be done to deploy this, presumably alongside some of running bots?

@jberry-suse jberry-suse deleted the jberry-suse:devel-project-list branch Jan 11, 2017
@lnussel

This comment has been minimized.

Copy link
Member

lnussel commented Jan 11, 2017

@nilxam or @DimStar77 could you add this to packagelists tmux maybe? For that it would be helpful to rebase on ToolBase.py so we get the common runner function and avoid a shell loop.

@lnussel

This comment has been minimized.

Copy link
Member

lnussel commented Jan 16, 2017

up and running

@jberry-suse

This comment has been minimized.

Copy link
Contributor Author

jberry-suse commented Jan 16, 2017

The one thing that will probably need to be done for this to be more useful is adding other projects to the cronjob. All the main distro projects (like Leap:42.3) and such are also queried and take forever. Additional, I would feel more comfortable increasing the ttl on those caches to a week or more if we had a way to detect package deletions.

@nilxam

This comment has been minimized.

Copy link
Contributor

nilxam commented Jan 17, 2017

well not every main distro projects has the devel project set, like 42.3 :)

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

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.