mirror of
https://opendev.org/openstack/governance.git
synced 2026-01-16 23:00:30 +00:00
Currently, if any project goes inactive, we mark it as inactive in the below doc - https://governance.openstack.org/tc/reference/emerging-technology-and-inactive-projects.html#current-inactive-projects which is not very visible to everyone and official list of projects (projects.yaml) does not provide the project status info. I am adding the new field 'status' in projects.yaml which can be added for the inactive project with 'inactive' value. Unless any project is marked as 'inactive', everything else in projects.yaml can be considered as active. Also, updating the existing inactive project status. Change-Id: Iee27669bb3a03befa06dc287be394063c0df5818 Signed-off-by: Ghanshyam Maan <gmaan@ghanshyammann.com>
182 lines
6.6 KiB
Python
182 lines
6.6 KiB
Python
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
"""Report on the current list of projects.
|
|
"""
|
|
|
|
from docutils import nodes
|
|
from docutils.parsers import rst
|
|
from docutils import statemachine
|
|
from sphinx.util import logging
|
|
from sphinx.util.nodes import nested_parse_with_titles
|
|
|
|
import projects
|
|
|
|
LOG = logging.getLogger(__name__)
|
|
|
|
IRC_LOG_URL_BASE = 'http://eavesdrop.openstack.org/irclogs/%23'
|
|
|
|
INACTIVE_PROJECTS_DOC = 'https://governance.openstack.org/tc/reference/emerging-technology-and-inactive-projects.html'
|
|
|
|
|
|
def _team_to_rst(name, info):
|
|
|
|
if 'service' in info:
|
|
title = "{0} ({1})".format(name.title(), info['service'])
|
|
elif name == 'I18n':
|
|
title = name
|
|
else:
|
|
title = name.title()
|
|
|
|
yield '.. _project-%s:' % projects.slugify(name)
|
|
yield ''
|
|
yield '=' * len(title)
|
|
yield title
|
|
yield '=' * len(title)
|
|
yield ''
|
|
yield ':Home Page: ' + info.get('url', '')
|
|
ptl = info.get('ptl', {'name': '', 'irc': '', 'email': ''})
|
|
leadership_type = info.get('leadership_type')
|
|
if leadership_type:
|
|
yield ':Leadership Type: ' + leadership_type
|
|
else:
|
|
yield ':PTL: %(name)s (``%(irc)s``) <%(email)s>' % ptl
|
|
irc_channel = info.get('irc-channel')
|
|
if irc_channel:
|
|
yield ':IRC Channel: `#%s <%s%s>`__' % (
|
|
irc_channel, IRC_LOG_URL_BASE, irc_channel)
|
|
service = info.get('service')
|
|
if service:
|
|
yield ':Service: ' + service
|
|
status = info.get('status')
|
|
if status and status == 'inactive':
|
|
yield ':Status: ' + '`Inactive <%s>`__ (This team needs maintainers, if you are interested, please contact OpenStack TC.)' % INACTIVE_PROJECTS_DOC
|
|
liaisons = info.get('liaisons')
|
|
if liaisons:
|
|
contact_format = {'name': '', 'irc': '', 'email': ''}
|
|
release = liaisons.get('release', contact_format)
|
|
if release != contact_format:
|
|
yield ':Release Liaisons: ' + ', '.join(
|
|
'%(name)s (``%(irc)s``) <%(email)s>' % rl
|
|
for rl in release)
|
|
tact_sig = liaisons.get('tact-sig', contact_format)
|
|
if tact_sig != contact_format:
|
|
yield ':TACT SIG Liaisons: ' + ', '.join(
|
|
'%(name)s (``%(irc)s``) <%(email)s>' % tl
|
|
for tl in tact_sig)
|
|
security = liaisons.get('security', contact_format)
|
|
if security != contact_format:
|
|
yield ':Security Liaisons: ' + ', '.join(
|
|
'%(name)s (``%(irc)s``) <%(email)s>' % sl
|
|
for sl in security)
|
|
tc_liaison = liaisons.get('tc-liaison', contact_format)
|
|
if tc_liaison != contact_format:
|
|
yield ':TC Liaisons: ' + ', '.join(
|
|
'%(name)s (``%(irc)s``) <%(email)s>' % tl
|
|
for tl in tc_liaison)
|
|
events = liaisons.get('events', contact_format)
|
|
if events != contact_format:
|
|
yield ':Events Liaisons: ' + ', '.join(
|
|
'%(name)s (``%(irc)s``) <%(email)s>' % el
|
|
for el in events)
|
|
project_update_onboarding = liaisons.get('project_update_onboarding', contact_format)
|
|
if project_update_onboarding != contact_format:
|
|
yield ':Project Update Onboarding Liaisons: ' + ', '.join(
|
|
'%(name)s (``%(irc)s``) <%(email)s>' % pl
|
|
for pl in project_update_onboarding)
|
|
meeting_facilitator = liaisons.get('meeting_facilitator', contact_format)
|
|
if meeting_facilitator != contact_format:
|
|
yield ':Meeting Facilitator Liaisons: ' + ', '.join(
|
|
'%(name)s (``%(irc)s``) <%(email)s>' % ml
|
|
for ml in meeting_facilitator)
|
|
bug_deputy = liaisons.get('bug_deputy', contact_format)
|
|
if bug_deputy != contact_format:
|
|
yield ':Bug Deputy Liaisons: ' + ', '.join(
|
|
'%(name)s (``%(irc)s``) <%(email)s>' % bl
|
|
for bl in bug_deputy)
|
|
rfe_coordinator = liaisons.get('rfe_coordinator', contact_format)
|
|
if rfe_coordinator != contact_format:
|
|
yield ':RFE Coordinator Liaisons: ' + ', '.join(
|
|
'%(name)s (``%(irc)s``) <%(email)s>' % rcl
|
|
for rcl in rfe_coordinator)
|
|
yield ''
|
|
mission = info.get('mission', '').rstrip()
|
|
if mission:
|
|
yield "Mission"
|
|
yield '-------'
|
|
yield ''
|
|
yield mission
|
|
yield ''
|
|
yield 'Deliverables'
|
|
yield '------------'
|
|
yield ''
|
|
deliverables = info.get('deliverables', [])
|
|
if deliverables:
|
|
for repo_name, deliverable in deliverables.items():
|
|
yield repo_name
|
|
yield '~' * len(repo_name)
|
|
yield ''
|
|
yield ':Repositories: ' + ', '.join(
|
|
':repo:`%s`' % repo
|
|
for repo in deliverable.get('repos', [])
|
|
)
|
|
yield ''
|
|
else:
|
|
yield 'None'
|
|
yield ''
|
|
if info.get('extra-acs', []):
|
|
yield 'Extra ACs'
|
|
yield '-----------'
|
|
yield '.. extraacstable::'
|
|
yield ' :project: %s' % name
|
|
yield ''
|
|
|
|
|
|
def _write_team_pages():
|
|
all_teams = projects.get_project_data()
|
|
files = []
|
|
for team, info in all_teams.items():
|
|
slug = projects.slugify(team)
|
|
filename = 'reference/projects/%s.rst' % slug
|
|
LOG.info('generating team page for %s' % team)
|
|
with open(filename, 'w', encoding='utf-8') as f:
|
|
f.write('\n'.join(_team_to_rst(team, info)))
|
|
files.append(filename)
|
|
return files
|
|
|
|
|
|
class TeamsListDirective(rst.Directive):
|
|
|
|
has_content = False
|
|
|
|
def run(self):
|
|
all_teams = projects.get_project_data()
|
|
|
|
# Build the view of the data to be parsed for rendering.
|
|
result = statemachine.ViewList()
|
|
for team_name in sorted(all_teams.keys()):
|
|
team_info = all_teams[team_name]
|
|
for line in _team_to_rst(team_name, team_info):
|
|
result.append(line, '<' + __name__ + '>')
|
|
|
|
# Parse what we have into a new section.
|
|
node = nodes.section()
|
|
node.document = self.state.document
|
|
nested_parse_with_titles(self.state, result, node)
|
|
|
|
return node.children
|
|
|
|
|
|
def setup(app):
|
|
LOG.info('loading teams extension')
|
|
app.add_directive('teamslist', TeamsListDirective)
|
|
_write_team_pages()
|