Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 121 additions & 0 deletions all_repos
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
#!/usr/bin/env python

import argparse

import requests

from itertools import chain
from fpo import load_config

REPOS_URL = 'https://api.github.com/orgs/%(owner)s/repos'
ORGS = ['theforeman']

EXCLUDED_REPOS = [

#'theforeman/ansible-foreman_scap_client',
#'theforeman/foreman-ansible-modules',
#'theforeman/foreman-discovery-image',
#'theforeman/foreman-fapolicyd',
#'theforeman/foreman-installer',
#'theforeman/foreman-mcp-server',
#'theforeman/foreman-operations-collection',
#'theforeman/foreman-selinux',
#'theforeman/foreman_kernel_care',
#'theforeman/foreman_maintain',
#'theforeman/foreman_opennebula',
#'theforeman/foreman_scap_client',
#'theforeman/foreman_scap_client_bash',
#'theforeman/foreman_ygg_worker',
#'theforeman/foremanctl',
#'theforeman/hammer-cli'
#'theforeman/hammer-cli-foreman',
#'theforeman/hammer-cli-foreman-statistics',
#'theforeman/journald-logger',
#'theforeman/journald-native',
#'theforeman/kafo',
#'theforeman/kafo_parsers',
#'theforeman/kafo_wizards',
#'theforeman/katello-pull-transport-migrate',
#'theforeman/katello-selinux',
#'theforeman/ldap_fluff',
#'theforeman/obsah',
#'theforeman/puppet-foreman_scap_client',
#'theforeman/puppet-iop',
#'theforeman/puppet-iop_advisor_engine',
#'theforeman/safemode',
#'theforeman/smart-proxy',
#'theforeman/smart_proxy_discovery_image',
#'theforeman/smart_proxy_vault',
'theforeman/.github',
'theforeman/actions',
'theforeman/apidocs',
'theforeman/candlepin-oci-images',
'theforeman/candlepin-packaging',
'theforeman/foreman',
'theforeman/foreman-graphics',
'theforeman/foreman-infra',
'theforeman/foreman-installer-modulesync',
'theforeman/foreman-js',
'theforeman/foreman-oci-images',
'theforeman/foreman-packaging',
'theforeman/foreman-plugin-overview',
'theforeman/foreman_transfer_repo',
'theforeman/gha-matrix-builder',
'theforeman/gha-matrix-ruby-verifier',
'theforeman/jenkins-jobs',
'theforeman/kafo_module_lint',
'theforeman/nboci-files',
'theforeman/npm2rpm',
'theforeman/obal',
'theforeman/prprocessor',
'theforeman/pulp-oci-images',
'theforeman/pulpcore-packaging',
'theforeman/puppet-foreman_simple_user',
'theforeman/puppet-katello_devel',
'theforeman/puppet-motd',
'theforeman/redmine_omniauth_github',
'theforeman/redmine_release_fields',
'theforeman/redmine_ruby_code',
'theforeman/smart_proxy_dns_plugin_template',
'theforeman/smart_proxy_example',
'theforeman/smart_proxy_plugin_template',
'theforeman/smoker',
'theforeman/theforeman-rel-eng',
'theforeman/tool_belt',
]

all_repos = set()



def main():
parser = argparse.ArgumentParser()
parser.add_argument('--filename', '-f', default='config.yaml', type=argparse.FileType())

args = parser.parse_args()
data = load_config(args.filename)

known_repos = set()
for entry in chain(data['cli']['plugins'], data['foreman']['plugins'], data['smart_proxy']['modules'], data['smart_proxy']['providers'], data['installer']['modules'], data['client'], data['libraries'], data['auxiliary']):
known_repos.add(entry.url.replace('https://github.com/', ''))


for org in ORGS:
u = REPOS_URL % {'owner': org}
while (u):
r = requests.get(u)
if (r.ok):
repos = r.json()
for repo in repos:
full_name = f'{org}/{repo['name']}'
if repo['archived'] or repo['fork'] or full_name in EXCLUDED_REPOS:
continue
all_repos.add(full_name)
if 'next' in r.links:
u = r.links['next']['url']
else:
u = None
print(all_repos-known_repos)

if __name__ == '__main__':
main()
36 changes: 36 additions & 0 deletions check_release
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env python3

import argparse

import requests

from itertools import chain
from fpo import load_config, Entry

def main():
parser = argparse.ArgumentParser()
parser.add_argument('--filename', '-f', default='config.yaml', type=argparse.FileType())

args = parser.parse_args()
data = load_config(args.filename)

needs_action = []
needs_update = []

for entry in chain(data['cli']['plugins'], data['foreman']['plugins'], data['smart_proxy']['modules'], data['smart_proxy']['providers'], data['installer']['modules']):
release_url = f'{entry.url}/raw/HEAD/.github/workflows/release.yml'
release_file = requests.get(release_url)
if release_file.ok:
if entry.release_action is not None and entry.release_action not in release_file.text:
needs_update.append(f'* `{entry.name}` needs to use `{entry.release_action}` in {release_url}')
else:
needs_action.append(f'* `{entry.name}` needs a release action at {release_url}')
if needs_action:
print("# NEEDS ACTION")
print('\n'.join(sorted(needs_action)))
if needs_update:
print("# NEEDS UPDATE")
print('\n'.join(sorted(needs_update)))

if __name__ == '__main__':
main()
5 changes: 5 additions & 0 deletions fpo.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class Entry:
github_org: str = 'theforeman'
installer: bool = True
description: str | None = None
release_action: str | None = None

@property
def ci_badges(self):
Expand Down Expand Up @@ -45,6 +46,7 @@ def ci_badges(self):
def __post_init__(self):
if not self.name:
self.name = f'puppet-{self.short_name}'
self.release_action = 'voxpupuli/gha-puppet/.github/workflows/release.yml'
super().__post_init__()


Expand Down Expand Up @@ -125,6 +127,7 @@ class ForemanPlugin(PackagedEntry):
def __post_init__(self):
if not self.name:
self.name = f'foreman_{self.short_name}'
self.release_action = 'voxpupuli/ruby-release'
super().__post_init__()

@property
Expand All @@ -140,6 +143,7 @@ def __post_init__(self):
self.deb = self.name.replace("-", "_")
if self.puppet_acceptance_tests is True:
self.puppet_acceptance_tests = self.short_name
self.release_action = 'voxpupuli/ruby-release'
super().__post_init__()

@property
Expand All @@ -160,6 +164,7 @@ def __post_init__(self):
self.deb = self.name.replace("-", "_")
if self.puppet_acceptance_tests is None:
self.puppet_acceptance_tests = True
self.release_action = 'voxpupuli/ruby-release'
super().__post_init__()

@property
Expand Down