2.1. sle_prjmgr_tools package
2.1.1. Subpackages
- 2.1.1.1. sle_prjmgr_tools.config package
- 2.1.1.2. sle_prjmgr_tools.utils package
- 2.1.1.2.1. Submodules
- 2.1.1.2.2. sle_prjmgr_tools.utils.confluence module
- 2.1.1.2.3. sle_prjmgr_tools.utils.jira module
- 2.1.1.2.4. sle_prjmgr_tools.utils.osc module
BinaryParsedOscReleaseHelperOscUtilsOscUtils.convert_project_to_product()OscUtils.get_file_from_package()OscUtils.osc_do_release()OscUtils.osc_get_binary_names()OscUtils.osc_get_containers()OscUtils.osc_get_jsc_from_sr()OscUtils.osc_get_products()OscUtils.osc_get_textfile_from_rpm()OscUtils.osc_get_web_ui_url()OscUtils.osc_is_repo_published()OscUtils.osc_prepare()OscUtils.osc_retrieve_betaversion()
- 2.1.1.2.5. Module contents
2.1.2. Submodules
2.1.3. sle_prjmgr_tools.cli module
This is the wrapper script that specifies the CLI entry point that can load the scripts from a config file.
The config file has the following format: { “modules”: [ “module1”, “module2” ] }
Valid locations for the configuration file are:
“/etc/sle-prjmgr-tools.json”
“$XDG_CONFIG_HOME/sle-prjmgr-tools.json”
“$RELEASE_MANAGEMENT_TOOLS_FILE”
A module must have a “build_parser” method that takes a single argument. The method is responsible to assign with “set_default” the func kwarg. The CLI entrypoint is called “main_cli” and has a single arguments that is an argparse namespace. This should be just a wrapper to the “main” function that has the actual arguments defined.
If no config is supplied the built-in configuration is used.
Example usage of the CLI for development (from git project root):
> . venv/bin/activate > export RELEASE_MANAGEMENT_TOOLS_FILE=”config/sle-prjmgr-tools.json” > python3 -m sle_prjmgr_tools.cli -h
- sle_prjmgr_tools.cli.import_plugin(name: str)
This method imports a plugin
- Parameters:
name – The name of the module in the “sle_prjmgr_tools” module.
- sle_prjmgr_tools.cli.main()
The main entrypoint for the library.
2.1.4. sle_prjmgr_tools.diff_modules module
Script to diff two well-known modules with each another.
- class sle_prjmgr_tools.diff_modules.DiffModuleOptions(project, revision)
Bases:
tuple- property project
Alias for field number 0
- property revision
Alias for field number 1
- class sle_prjmgr_tools.diff_modules.OscOptions(config, instance)
Bases:
tuple- property config
Alias for field number 0
- property instance
Alias for field number 1
- sle_prjmgr_tools.diff_modules.build_parser(parent_parser)
Builds the parser for this script. This is executed by the main CLI dynamically.
- Parameters:
parent_parser – The subparsers object from argparse.
- sle_prjmgr_tools.diff_modules.checkout_source_files(from_project: DiffModuleOptions, to_project: DiffModuleOptions, from_groups_filename: Path, to_groups_filename: Path, osc_config: Optional[OscOptions] = None)
Download the two “group.yml” files from “000package-groups” that will be compared.
- Parameters:
from_project – The project the source package is in.
to_project – The project the target package is in.
from_groups_filename – The desired filename for the source file.
to_groups_filename – The desired filename for the target file.
osc_config – The tuple with the osc options.
- sle_prjmgr_tools.diff_modules.cleanup_source_files(from_groups_filename: Path, to_groups_filename: Path)
Removes the temporary files.
- Parameters:
from_groups_filename – The file that acts as a source for the comparison.
to_groups_filename – The file that acts as a target for the comparison.
- sle_prjmgr_tools.diff_modules.diff_file(from_groups: Path, to_groups: Path, changes_file: Path)
Diff the two files and write it to the third file.
- Parameters:
from_groups – The source file that should be modified.
to_groups – The target file that should be modified.
changes_file – The file with the resulting changes.
- sle_prjmgr_tools.diff_modules.main(from_project: DiffModuleOptions, to_project: DiffModuleOptions, osc_config: Optional[OscOptions] = None) str
Main routine executes the non-CLI related logic.
- Parameters:
from_project – The source project that should be compared.
to_project – The target project that should be compared.
osc_config – The osc configuration that should be used.
- sle_prjmgr_tools.diff_modules.main_cli(args)
Main routine that executes the script
- Parameters:
args – Argparse Namespace that has all the arguments
- sle_prjmgr_tools.diff_modules.output_mark_added_packages(changes_file: Path)
Mark all packages that are added.
- Parameters:
changes_file – The file that should be modified.
- sle_prjmgr_tools.diff_modules.output_mark_packages_in_to_file(to_groups: Path)
Mark all package in the target file.
- Parameters:
to_groups – The file that should be modified.
- sle_prjmgr_tools.diff_modules.output_mark_removed_packages(changes_file: Path)
Mark all packages that are removed.
- Parameters:
changes_file – The file that should be modified.
- sle_prjmgr_tools.diff_modules.output_remove_dashes(changes_file: Path)
Remove all dashes from the diff.
- Parameters:
changes_file – The file that should be modified.
- sle_prjmgr_tools.diff_modules.output_remove_empty_lines(changes_file: Path)
Remove all empty lines from the diff.
- Parameters:
changes_file – The file that should be modified.
- sle_prjmgr_tools.diff_modules.output_remove_line_numbers(changes_file: Path)
Remove all line numbers from the file.
- Parameters:
changes_file – The file that should be modified.
- sle_prjmgr_tools.diff_modules.output_remove_repeated_module_names(changes_file: Path)
Remove all repeated module names from the diff.
- Parameters:
changes_file – The file that should be modified.
Remove all packages that are unrelated to modules.
- Parameters:
changes_file – The file that should be modified.
- sle_prjmgr_tools.diff_modules.output_removed_from_module_names(changes_file: Path)
Mark packages that are removed from a module.
- Parameters:
changes_file – The file that should be modified.
- sle_prjmgr_tools.diff_modules.remove_comments(from_groups: Path, to_groups: Path)
Remove all comments from the two files.
- Parameters:
from_groups – The source file that should be modified.
to_groups – The target file that should be modified.
- sle_prjmgr_tools.diff_modules.run_sed(expression: str, file: Path)
Runs the given sed Expression on a specified file.
- Parameters:
expression – The sed expression.
file – The file that should be used.
2.1.5. sle_prjmgr_tools.incident_repos module
This script retrieves all repositories for each incident it is given. The datasource is the SUSE internal SMELT tool.
- sle_prjmgr_tools.incident_repos.build_parser(parent_parser)
Builds the parser for this script. This is executed by the main CLI dynamically.
- Parameters:
parent_parser – The subparsers object from argparse.
- sle_prjmgr_tools.incident_repos.get_incident_repos(smelt_api_url: str, iid: int, timeout=180)
Retrieve all repositories that are affected by a single incident.
- Parameters:
smelt_api_url – The URL where the SMELT GraphQL API is present.
iid – The incident ID.
timeout – The timeout that is used for the SMELT API.
- Returns:
The set of repositories that is affected.
- sle_prjmgr_tools.incident_repos.main(smelt_api_url: str, incidents: List[int])
Main routine executes the non-CLI related logic.
- Parameters:
smelt_api_url – The URL where the SMELT GraphQL API is present.
incidents – The list of incidents that should be looked up.
- sle_prjmgr_tools.incident_repos.main_cli(args)
Main routine that executes the script
- Parameters:
args – Argparse Namespace that has all the arguments
2.1.6. sle_prjmgr_tools.jira_epics module
Get all JIRA Issues that are mentioned in the changelog of a project.
- sle_prjmgr_tools.jira_epics.build_parser(parent_parser)
Builds the parser for this script. This is executed by the main CLI dynamically.
- Parameters:
parent_parser – The subparsers object from argparse.
- sle_prjmgr_tools.jira_epics.get_issue_list(apiurl: str, target: str, package: str) List[str]
Scans the changelog for a specific package for jsc mentions.
- Parameters:
apiurl – URL where the API from the build-service can be reached.
target – The target project that this is checked against.
package – The package that should be scanned for issues.
- Returns:
The list of issues that could be found.
- sle_prjmgr_tools.jira_epics.main(apiurl='https://api.suse.de', target='SUSE:SLE-15-SP3:GA') Dict[str, List[str]]
Main routine executes the non-CLI related logic.
- Parameters:
apiurl – URL where the API from the build-service can be reached.
target – The target project that this is checked against.
- sle_prjmgr_tools.jira_epics.main_cli(args)
Main routine that executes the script
- Parameters:
args – Argparse Namespace that has all the arguments
- sle_prjmgr_tools.jira_epics.osc_packages_exclude_000(apiurl: str, target: str) List[str]
Retrieve a list of packages for a given project where all packages starting with
000are being excluded.- Parameters:
apiurl – URL where the API from the build-service can be reached.
target – The target project to search.
- Returns:
The list of packages in the project.
- sle_prjmgr_tools.jira_epics.osc_prepare()
This has to be executed to the ini-style config is converted into their corresponding types.
- sle_prjmgr_tools.jira_epics.scan_commitlog_for_issues(apiurl: str, target: str, package: str) List[str]
Scans the commitlog for a specific package for jsc mentions.
- Parameters:
apiurl – URL where the API from the build-service can be reached.
target – The target project that this is checked against.
package – The package that should be scanned for issues.
- Returns:
The list of issues that could be found.
2.1.7. sle_prjmgr_tools.list_accepted_pkgs module
Module to list all accepted SRs that are accepted that changed, added or removed a package.
- sle_prjmgr_tools.list_accepted_pkgs.build_parser(parent_parser)
Builds the parser for this script. This is executed by the main CLI dynamically.
- Returns:
The subparsers object from argparse.
- sle_prjmgr_tools.list_accepted_pkgs.filter_requests(days: int, requests) list
Filter a given list by its date. The time of days is respected and not rounded. A request that was submitted at 2pm on the earliest days that is included would be ignored if it is 3pm during execution of this method.
- Parameters:
days – The days that should be filtered
requests – The list with the requests to filter.
- Returns:
Filter list where every request is younger than the days specified.
- sle_prjmgr_tools.list_accepted_pkgs.main(apiurl: str, project: str, time_range: int) Tuple[list, list]
Main routine executes the non-CLI related logic.
- Parameters:
apiurl – URL where the API from the build-service can be reached.
project – The project that should be queried.
time_range – The list of days that present the delimiter for the filter
- Returns:
A Tuple with the list of requests
- sle_prjmgr_tools.list_accepted_pkgs.main_cli(args)
Main routine that executes the script
- Parameters:
args – Argparse Namespace that has all the arguments
- sle_prjmgr_tools.list_accepted_pkgs.osc_get_delete_requests(project: str)
Looks in the IBS the list of requests up that are accepted and that delete a package.
- Parameters:
project – The project that should be checked.
- Returns:
The list of requests objects that are found with the state accepted and that are deleting a package.
- sle_prjmgr_tools.list_accepted_pkgs.osc_get_submit_requests(project: str)
Looks in the IBS the list of requests up that are accepted and submitted.
- Parameters:
project – The project that should be checked.
- Returns:
The list of requests objects that are found with the state accepted and that are submitted.
- sle_prjmgr_tools.list_accepted_pkgs.osc_prepare(osc_config: Optional[str] = None, osc_server: Optional[str] = None)
This has to be executed to the ini-style config is converted into their corresponding types.
- Parameters:
osc_config – Path to the configuration file for osc. The default delegates the task to the osc library.
osc_server – Server URL that points to the OBS server API.
2.1.8. sle_prjmgr_tools.package_updates_from_xcdchk module
This script retrieves all updates to packages between two builds.
- class sle_prjmgr_tools.package_updates_from_xcdchk.JiraResponse(query, comment, labels)
Bases:
tuple- property comment
Alias for field number 1
- property labels
Alias for field number 2
- property query
Alias for field number 0
- class sle_prjmgr_tools.package_updates_from_xcdchk.PackageUpdatedFromXcdChkResult(xcdchk_data, bsc_query, jira_references, jira_queries)
Bases:
tuple- property bsc_query
Alias for field number 1
- property jira_queries
Alias for field number 3
- property jira_references
Alias for field number 2
- property xcdchk_data
Alias for field number 0
- class sle_prjmgr_tools.package_updates_from_xcdchk.XcdCheckFetchOptions(url='', timeout=60)
Bases:
objectThis class is responsible to hold the options for fetching data from xcdchk.
- class sle_prjmgr_tools.package_updates_from_xcdchk.XcdCheckRawData
Bases:
objectThis class is responsible for holding the raw data of the script.
- class sle_prjmgr_tools.package_updates_from_xcdchk.XcdChkData
Bases:
objectThis class is responsible for holding the data of the script.
- class sle_prjmgr_tools.package_updates_from_xcdchk.XcdChkUpdatedPackageVersion(old_version='', new_version='')
Bases:
objectThis class is responsible for holding the package versions.
- sle_prjmgr_tools.package_updates_from_xcdchk.build_bsc_query_p1_p2(changelog: str) str
Builds the query for all P1 & P2 bugs that can be found in Bugzilla.
- Params changelog:
The str with the full changelog.
- Returns:
The str with the full URL that includes the query.
- sle_prjmgr_tools.package_updates_from_xcdchk.build_jira_query(query: str, comment: str, labels: str) JiraResponse
Builds a JIRA query tuple.
- Parameters:
query – The query that should be attached to the tuple.
comment – The comment that should be attached to the tuple.
labels – The labels that should be attached to the tuple.
- Returns:
The built JiraResponse tuple.
- sle_prjmgr_tools.package_updates_from_xcdchk.build_jira_query_completed(ped: str, build2: str) JiraResponse
Builds a Jira Query that shows all issues that are in a completed state.
- Parameters:
ped – The list of ped issues seperated by commas.
build2 – The newer of the two build numbers available to the script.
- Returns:
The built JiraResponse tuple.
- sle_prjmgr_tools.package_updates_from_xcdchk.build_jira_query_development(ped: str, build2: str) JiraResponse
Builds a Jira Query that shows all issues that are in development state.
- Parameters:
ped – The list of ped issues seperated by commas.
build2 – The newer of the two build numbers available to the script.
- Returns:
The built JiraResponse tuple.
- sle_prjmgr_tools.package_updates_from_xcdchk.build_jira_query_incorrect(ped: str, build2: str) JiraResponse
Builds a Jira Query that shows all issues that are in an incorrect state and that must be manually handled.
- Parameters:
ped – The list of ped issues seperated by commas.
build2 – The newer of the two build numbers available to the script.
- Returns:
The built JiraResponse tuple.
- sle_prjmgr_tools.package_updates_from_xcdchk.build_jira_query_ready(ped: str, build2: str) JiraResponse
Builds a Jira Query that shows all issues that are ready to be moved to their next status automatically.
- Parameters:
ped – The list of ped issues seperated by commas.
build2 – The newer of the two build numbers available to the script.
- Returns:
The built JiraResponse tuple.
- sle_prjmgr_tools.package_updates_from_xcdchk.build_parser(parent_parser)
Builds the parser for this script. This is executed by the main CLI dynamically.
- Returns:
The subparsers object from argparse.
- sle_prjmgr_tools.package_updates_from_xcdchk.build_ped_list(changelog: str) List[str]
Scans a given changelog for PED issues.
- Parameters:
changelog – The str with the full changelog between two images.
- Returns:
The list of PED issues that can be found.
- sle_prjmgr_tools.package_updates_from_xcdchk.main(version: str, origin_version: str, build1: str, build2: str, xcdchk_options: XcdCheckFetchOptions) PackageUpdatedFromXcdChkResult
Main routine executes the non-CLI related logic.
- sle_prjmgr_tools.package_updates_from_xcdchk.main_cli(args)
Main routine that executes the script
- Parameters:
args – Argparse Namespace that has all the arguments
- sle_prjmgr_tools.package_updates_from_xcdchk.mentioned_jira_references(changelog: str) List[str]
Scans a given changelog for SLE and PED issues.
- Parameters:
changelog – The str with the full changelog between two images.
- Returns:
The list of SLE and PED issues that can be found.
- sle_prjmgr_tools.package_updates_from_xcdchk.print_from_to_version_package(name: str, from_version: str, to_version: str)
Formats a package that has a version for printing on stdout.
- sle_prjmgr_tools.package_updates_from_xcdchk.print_jira_query(header: str, jira_query: str, comment: str, labels: str)
Formats a JIRA query for printing to stdout.
- sle_prjmgr_tools.package_updates_from_xcdchk.xcdchk_added_pkgs(changelog: str, added: str) Dict[str, str]
This function parses the added packages from their changelogs and then searches for the version from and to version in the added packages file.
- Parameters:
changelog – The changelog to search through.
added – The added packages to search through.
- Returns:
A dict where package names are keys and versions are the values.
- sle_prjmgr_tools.package_updates_from_xcdchk.xcdchk_downgraded_pkgs(downgraded_rpms: str) Dict[str, XcdChkUpdatedPackageVersion]
Parse the list of downgraded packages and return a well formatted result for further work.
- Parameters:
downgraded_rpms – The str with the list of downgraded packages.
- Returns:
A dictionary where the keys are package names and the value for each package is a version object.
- sle_prjmgr_tools.package_updates_from_xcdchk.xcdchk_fetch_data(version: str, origin_version: str, build1: str, build2: str, xcdchk_options: XcdCheckFetchOptions) XcdCheckRawData
Fetches the data of xcdchk.
- Parameters:
version – The SLES version that is paired to the newer of the two builds.
origin_version – The SLES version that is paired to the older version of the two builds.
build1 – The older of the two builds.
build2 – The newer of the two builds.
xcdchk_options – The options that are used to fetch the data from xcdchk
- Returns:
The object that contains all the data that is needed for the script to work.
- sle_prjmgr_tools.package_updates_from_xcdchk.xcdchk_mentioned_bugs(changelog: str) List[str]
Find all openSUSE, SUSE or Novell Bugzilla references in the changelog.
- Parameters:
changelog – The str with the full changelog.
- Returns:
The sorted list with the Bugzilla bug numbers.
- sle_prjmgr_tools.package_updates_from_xcdchk.xcdchk_removed_pkgs(missing_rpms: str) List[str]
This function parses the removed packages from the removed packages file.
- Parameters:
missing_rpms – The file to search through where missing RPMs are listed.
- Returns:
The list of packages has been removed.
- sle_prjmgr_tools.package_updates_from_xcdchk.xcdchk_updated_pkgs(changelog: str, updated: str) Dict[str, XcdChkUpdatedPackageVersion]
This function parses the updated packages from their changelogs and then searches for the version from and to version in the updated packages file.
- Parameters:
changelog – The changelog to search through.
updated – The updated packages to search through.
- Returns:
The keys are package names and the value of each key is the NamedTuple “XcdChkUpdatedPackageVersion”.
2.1.9. sle_prjmgr_tools.packagelist_report module
This script calculates a diff between two project revisions and writes its output to a file where the added, moved and removed packages are named.
- sle_prjmgr_tools.packagelist_report.build_parser(parent_parser)
Builds the parser for this script. This is executed by the main CLI dynamically.
- Parameters:
parent_parser – The subparsers object from argparse.
- sle_prjmgr_tools.packagelist_report.calculcate_package_diff(old_file: dict, new_file: dict) Optional[str]
Calculate the package diff between the two dictionaries that were passed.
- Parameters:
old_file – Dictionary with the content from the source project.
new_file – Dictionary with the content from the target project.
- Returns:
The str with the generated report. As generated by
generate_package_diff_report().
- sle_prjmgr_tools.packagelist_report.convert_txt_to_dict(file_content: str) Dict[str, List[str]]
Converts the text file downloaded and parses
- Parameters:
file_content – The string that should be split
- Returns:
The dictionary with the package names as key and the list of groups they are in as a list.
- sle_prjmgr_tools.packagelist_report.convert_yml_to_dict(file_content: str, unsorted=False) Dict[str, List[str]]
Loads the file content as a YAML file and then parses it according to the expected file structure.
- Parameters:
file_content – The content of the YAML file.
unsorted – If the package should be added to unsorted or not explicitly.
- Returns:
The dictionary with the package names as key and the list of groups they are in as a list.
- sle_prjmgr_tools.packagelist_report.download_file(cmd: str)
Takes an osc command returns the stdout.
- Parameters:
cmd – The osc command to run.
- Returns:
The stdout output.
- sle_prjmgr_tools.packagelist_report.generate_package_diff_report(added: dict, moved: dict, removed: dict) str
Generates the report with the help of the presorted dictionaries.
- Parameters:
added – The dict with added packages
moved – The dict with moved packages
removed – The dict with removed packages
- Returns:
The str with the generated report. Newlines for formatting are present.
- sle_prjmgr_tools.packagelist_report.get_file_content(project: str, revision: str)
Retrieves the file content of a text file from 000package-groups.
- Parameters:
project – The project that should be checked.
revision – The project revision to get the file from.
- Returns:
The
- sle_prjmgr_tools.packagelist_report.get_txt_file(cmd: str, revision) Optional[Dict[str, List[str]]]
Retrieve and parse the content of
summary-staging.txt.- Parameters:
cmd – The pre-built command that should be used.
revision – The project revision to get the file from.
- Returns:
The file that has been downloaded by osc and then parsed by
convert_txt_to_dict().
- sle_prjmgr_tools.packagelist_report.get_yml_files(command: str, revision) Optional[Dict[str, List[str]]]
Retrieve the different reference YAML files and parse them.
- Parameters:
command – The pre-built command that should be used.
revision – The project revision to get the file from.
- Returns:
The dictionary with the package names as key and the list of groups they are in as a list.
- sle_prjmgr_tools.packagelist_report.main(from_project: str, from_revision_number: str, to_project: str, to_revision_number: str)
Main routine executes the non-CLI related logic.
- Parameters:
from_project – Source project that should be used as a base.
from_revision_number – Project revision number.
to_project – Source project that should be used as a comparison target.
to_revision_number – Project revision number.
- sle_prjmgr_tools.packagelist_report.main_cli(args)
Main routine that executes the script
- Parameters:
args – Argparse Namespace that has all the arguments
- sle_prjmgr_tools.packagelist_report.read_summary_file(file: str) Dict[str, List[str]]
Reads a file and interprets it in the format of
summary-staging.txt.- Parameters:
file – The path to the file.
- Returns:
The dict with the package names as keys and the list of groups as a value.
- sle_prjmgr_tools.packagelist_report.read_yaml_file(file, unsorted=False)
Loads the file content as a YAML file and then parses it according to the expected file structure.
- Parameters:
file – The content of the YAML file.
unsorted – If the package should be added to unsorted or not explicitly.
- Returns:
The dictionary with the package names as key and the list of groups they are in as a list.
- sle_prjmgr_tools.packagelist_report.write_summary_dict(file: str, content: Dict[str, List[str]]) None
Write a file to disk with the given content.
- Parameters:
file – The file path of the desired target.
content – The dict with the packages as keys and their categories as value.
- sle_prjmgr_tools.packagelist_report.write_summary_file(file: str, content: str) None
Write a file to disk with the given content.
- Parameters:
file – The file path of the desired target.
content – The content to write.
2.1.10. sle_prjmgr_tools.release_to module
Module that will release a :GA project to :GA:TEST or GA:PUBLISH.
- class sle_prjmgr_tools.release_to.ReleaseTargets(value)
Bases:
EnumThis Enum contains all possible release targets for this script.
- PUBLISH = 1
- TEST = 0
- sle_prjmgr_tools.release_to.build_parser(parent_parser)
Builds the parser for this script. This is executed by the main CLI dynamically.
- Parameters:
parent_parser – The subparsers object from argparse.
- sle_prjmgr_tools.release_to.main(obs_url: str, project: str, target: ReleaseTargets, osc_config: Optional[str] = None)
Main routine executes the non-CLI related logic.
- Parameters:
obs_url – URL to the OBS instance.
project – Project to release. Must include the
:GAsuffix but not more.target – Decides what the release target is.
osc_config – Path to the
.oscrc. It may beNoneif osc should handle the lookup.
- sle_prjmgr_tools.release_to.main_cli(args)
Main routine that executes the script
- Parameters:
args – Argparse Namespace that has all the arguments
2.1.11. sle_prjmgr_tools.search_binary module
Retrieve the Channel, Project and Source Package for a list of given binaries.
- sle_prjmgr_tools.search_binary.build_parser(parent_parser)
Builds the parser for this script. This is executed by the main CLI dynamically.
- Parameters:
parent_parser – The subparsers object from argparse.
- sle_prjmgr_tools.search_binary.get_binary_info(binary: str, timeout=180)
Retrieve all channel, project and source package names for a given binary.
- Parameters:
binary – The name of the binaries that should be searched for.
timeout – Timout when the connection should be aborted.
- Returns:
A Tuple with the name of the channel, project and source package is yielded.
- sle_prjmgr_tools.search_binary.main(binaries: List[str])
Main routine executes the non-CLI related logic.
- Parameters:
binaries – The list of binaries that should be checked.
- sle_prjmgr_tools.search_binary.main_cli(args)
Main routine that executes the script
- Parameters:
args – Argparse Namespace that has all the arguments
2.1.12. sle_prjmgr_tools.sle_build module
This module is responsible to collect the current build numbers of the various images that are built.
- class sle_prjmgr_tools.sle_build.Build(name='', mtime=0)
Bases:
objectHelper class that holds data about a single build.
- class sle_prjmgr_tools.sle_build.SleBuildData
Bases:
objectHelper class that holds all the builds and image names in one object.
- sle_prjmgr_tools.sle_build.build_parser(parent_parser)
Builds the parser for this script. This is executed by the main CLI dynamically.
- Parameters:
parent_parser – The subparsers object from argparse.
- sle_prjmgr_tools.sle_build.get_kiwi_template(apiurl: str, project: str) str
Retrieve the name of the kiwi template package
- Parameters:
apiurl – URL where the API from the build-service can be reached.
project – The project to look at.
- Returns:
The full name of the kiwi-template package.
- sle_prjmgr_tools.sle_build.get_sle_image_jeos_single(apiurl: str, project: str, repo, kiwi_template: str, i) List[str]
Search for JeOS images in a given project, repo and with the specified kiwi template.
- Parameters:
apiurl – URL where the API from the build-service can be reached.
project – The project to look at.
repo – The repository to search for jeos images.
kiwi_template – The full name of the kiwi package.
i – The flavor of the package that is being searched for.
- Returns:
The images that have been found.
- sle_prjmgr_tools.sle_build.get_sle_images_jeos(apiurl: str, project: str, kiwi_template: str) List[str]
multibuild JeOS
- Parameters:
apiurl – URL where the API from the build-service can be reached.
project – The project to look at.
kiwi_template – The full name of the kiwi package.
- Returns:
The list of names that the images from JeOS/Minimal will have.
- sle_prjmgr_tools.sle_build.get_sle_images_multibuild(apiurl: str, project: str)
Multibuild images such as cloud etc., typical name is “SLE12-SP5-EC2”. This is for 15.2+ and 12.5+.
- Parameters:
apiurl – URL where the API from the build-service can be reached.
project – The project to look at.
- sle_prjmgr_tools.sle_build.get_sle_images_multibuild_single(apiurl: str, project: str, repo, package: str, flavor: str)
Retrieve a list of images.
- Parameters:
apiurl – URL where the API from the build-service can be reached.
project – The project to look at.
repo – The repository to get the images from.
package – The package where the images are in.
flavor – The flavor of the package that should be checked.
- Returns:
The list of images.
- sle_prjmgr_tools.sle_build.get_sle_images_old_style(apiurl: str, project: str)
old style
- Parameters:
apiurl – URL where the API from the build-service can be reached.
project – The project to look at.
- sle_prjmgr_tools.sle_build.get_sle_images_old_style_single(apiurl: str, project, repo, i)
Retrieve the old style image names.
- Parameters:
apiurl – URL where the API from the build-service can be reached.
project – The project to look at.
repo – The repository to search for images.
i – The package to search for old-style images.
- Returns:
The names of the images as a list.
- sle_prjmgr_tools.sle_build.get_wsl_binaries(apiurl: str, project: str) List[str]
This method avoids displaying images-test/$arch.
- Parameters:
apiurl – URL where the API from the build-service can be reached.
project – The project to look for WSL images in.
- Returns:
A list of names for build WSL images.
- sle_prjmgr_tools.sle_build.main(apiurl: str, version: str, osc_config: Optional[str] = None) SleBuildData
Main function to get the builds for the specified version.
- Parameters:
apiurl – URL where the API from the build-service can be reached.
version – The version of the product to check. Should be in format “<codestream>-SP<number>”
osc_config – The config location for osc to use. If None then the default is retrieved by osc.
- Returns:
Object with the summarized data.
- sle_prjmgr_tools.sle_build.main_cli(args)
Main routine that executes the script
- Parameters:
args – Argparse Namespace that has all the arguments
- sle_prjmgr_tools.sle_build.osc_get_build_flavors(apiurl: str, project: str, package: str, filename: str) list
Reads the sources of a package to retrieve the allowed build flavors of an image.
- Parameters:
apiurl – URL where the API from the build-service can be reached.
project – The project to look at.
package – The package where the multibuild file is located is.
filename – The name of the multibuild file.
- Returns:
The list of flavors.
- sle_prjmgr_tools.sle_build.osc_get_builds(apiurl: str, project: str) List[Build]
Get builds from the build-service.
- Parameters:
apiurl – URL where the API from the build-service can be reached.
project – The project to look at.
- Returns:
The list with the image names.
- sle_prjmgr_tools.sle_build.osc_get_dvd_images(apiurl: str, version: str) List[str]
Get all SLE 12 style DVD images.
- Parameters:
apiurl – URL where the API from the build-service can be reached.
version – The version of SLE to look for.
- Returns:
The list of images that can be found.
- sle_prjmgr_tools.sle_build.osc_get_non_product_packages(apiurl: str, project: str) List[str]
Get a list of packages that are unrelated to the product building progress.
- Parameters:
apiurl – URL where the API from the build-service can be reached.
project – The project to look at.
- Returns:
The list of packages.
- sle_prjmgr_tools.sle_build.osc_get_sle_12_images(apiurl: str, version: str) Dict[str, Build]
Retrieves the list of SLE 12 images.
- Parameters:
apiurl – URL where the API from the build-service can be reached.
version – The version of SLE to check for.
- Returns:
A dict where the keys are build flavors and the values are build ids.
- sle_prjmgr_tools.sle_build.osc_get_sle_non_release_packages(apiurl: str, project: str)
Retrieve all packages that are not related to a release.
- Parameters:
apiurl – URL where the API from the build-service can be reached.
project – The project to look at.
- Returns:
The list of packages.
- sle_prjmgr_tools.sle_build.osc_prepare(osc_config: Optional[str] = None, osc_server: Optional[str] = None)
This has to be executed to the ini-style config is converted into their corresponding types.
- Parameters:
osc_config – Path to the configuration file for osc. The default delegates the task to the osc library.
osc_server – Server URL that points to the OBS server API.
- sle_prjmgr_tools.sle_build.sle_15_media_build(apiurl: str, project: str) Dict[str, Build]
Searches in the specified project for the current build flavors with their corresponding id.
- Parameters:
apiurl – URL where the API from the build-service can be reached.
project – The project to look at.
- Returns:
A dict where the keys are the build flavor and the values the build number.
- sle_prjmgr_tools.sle_build.sle_images(apiurl: str, project: str) List[str]
Collects all SLE 15 style images that can be found and sorts them.
- Parameters:
apiurl – URL where the API from the build-service can be reached.
project – The project to look at.
- Returns:
The list of images that can be found.
2.1.13. sle_prjmgr_tools.update_build_status_page module
Updates the build status page on Confluence for the service pack that is given with information from IBS.
- sle_prjmgr_tools.update_build_status_page.build_parser(parent_parser)
Builds the parser for this script. This is executed by the main CLI dynamically.
- Parameters:
parent_parser – The subparsers object from argparse.
- sle_prjmgr_tools.update_build_status_page.confluence_generate_build_summary(server: str, user: str, password: str, project: str, build_id: int, build_label: str, changelog: str)
Merge manually pre-filled section for next build with changelog from the build
- Parameters:
server – Confluence server URL
user – The user for Confluence to log in with.
password – The password for Confluence to log in with.
project – The project in the IBS to work with.
build_id – The override ID of the build that is being worked with.
build_label – The override label of the build that is being worked with.
changelog – The cached output of the
sle_buildscript.
- Returns:
The generated build summary.
- sle_prjmgr_tools.update_build_status_page.confluence_get_next_build_section(server: str, user: str, password: str, page_id: int)
Retrieve a section of a specified Confluence page.
- Parameters:
server – Confluence server URL
user – The user for Confluence to log in with.
password – The password for Confluence to log in with.
page_id – The ID of the Confluence page.
- Returns:
The content of the desired page.
- sle_prjmgr_tools.update_build_status_page.confluence_get_page_content(server: str, user: str, password: str, page_id: int, expand=False)
Retrieves the page content of a Confluence page.
- Parameters:
server – Confluence server URL
user – The user for Confluence to log in with.
password – The password for Confluence to log in with.
page_id – The ID of the Confluence page.
expand – Whether the page should be expanded or not.
- Returns:
The page content.
- sle_prjmgr_tools.update_build_status_page.confluence_get_page_heading(server: str, user: str, password: str, project: str)
Retrieves the heading of a Confluence page.
- Parameters:
server – Confluence server URL
user – The user for Confluence to log in with.
password – The password for Confluence to log in with.
project – The project in the IBS to work with.
- Returns:
The heading of the confluence page for the IBS project.
- sle_prjmgr_tools.update_build_status_page.confluence_get_prev_builds(server: str, user: str, password: str, project: str)
Retrieve the old page content of the specified project.
- Parameters:
server – Confluence server URL
user – The user for Confluence to log in with.
password – The password for Confluence to log in with.
project – The IBS project to work with.
- Returns:
The page content of the Confluence page for the specified IBS project.
- sle_prjmgr_tools.update_build_status_page.confluence_set_page_content(server: str, user: str, password: str, page_id: int, json_content)
Update a Confluence page with the given content.
- Parameters:
server – Confluence server URL
user – The user for Confluence to log in with.
password – The password for Confluence to log in with.
page_id – The page ID to update.
json_content – The JSON content that the Confluence API should expect.
- sle_prjmgr_tools.update_build_status_page.confluence_update_build_summary(server: str, user: str, password: str, project: str, build_id: int, changelog, next_build_date: date, build_label)
Updates the build summary of a Confluence page for a certain IBS project.
- Parameters:
server – Confluence server URL
user – The user for Confluence to log in with.
password – The password for Confluence to log in with.
project – The project in the IBS to work with.
build_id – The override ID of the build that is being worked with.
changelog – The cached output of the
sle_buildscript.next_build_date – Date of the next build.
build_label – The override label of the build that is being worked with.
- sle_prjmgr_tools.update_build_status_page.free_page_cache(url: str)
Checks if a page is cached and removes it if it is.
- Parameters:
url – The URL to check.
- sle_prjmgr_tools.update_build_status_page.generate_new_build_section(next_build_date: date)
Generates a section for the next build that will be released.
- Parameters:
next_build_date – The date that will be used for the next build.
- Returns:
The Confluence formatted section for the next build.
- sle_prjmgr_tools.update_build_status_page.get_last_build_changelog(project: str)
Retrieves the output of the
sle_buildscript.- Parameters:
project – The project name in IBS.
- Returns:
The output of the
sle_buildscript.
- sle_prjmgr_tools.update_build_status_page.get_last_build_number(project, changelog=None)
Retrieves the last build ID from the
sle_buildscript.- Parameters:
project – The project name in IBS.
changelog – The changelog from the build.
- Returns:
The build number.
- sle_prjmgr_tools.update_build_status_page.get_project(project: str)
Retrieves the desired project.
- Parameters:
project – The project to work with.
- Returns:
The project or SLES 15 SP1 for testing.
- sle_prjmgr_tools.update_build_status_page.main(server: str, user: str, password: str, build_id, build_label, next_build_date: str, project: str)
Main routine executes the non-CLI related logic.
- Parameters:
server – Confluence server URL
user – The user for Confluence to log in with.
password – The password for Confluence to log in with.
build_id – The override ID of the build that is being worked with.
build_label – The override label of the build that is being worked with.
next_build_date – The date of the next build.
project – The project in the IBS to work with.
- sle_prjmgr_tools.update_build_status_page.main_cli(args)
Main routine that executes the script
- Parameters:
args – Argparse Namespace that has all the arguments
- sle_prjmgr_tools.update_build_status_page.page_id_by_project(project: str)
Retrieve the page ID in Confluence by the IBS project name.
- Parameters:
project – The project name in IBS.
- Returns:
The page ID in Confluence.
- sle_prjmgr_tools.update_build_status_page.page_url_by_project(project: str)
Retrieve the page URL in Confluence by the IBS project name.
- Parameters:
project – The project name in IBS.
- Returns:
The URL to Confluence.
- sle_prjmgr_tools.update_build_status_page.to_html_list(data: str)
Converts a newline seperated str into a HTML tag seperated str.
- Parameters:
data – The str to convert.
- Returns:
The str with newlines replaced by the HTML
<br />tag.
2.1.14. Module contents
Main module of the project. Defines only the version atm.