{"id":20314472,"url":"https://github.com/release-engineering/retasc","last_synced_at":"2025-04-11T17:17:09.995Z","repository":{"id":239148109,"uuid":"798620684","full_name":"release-engineering/retasc","owner":"release-engineering","description":"Release Task Schedule Curator (ReTaSC) - Plans product release work in Jira based on schedules in Product Pages","archived":false,"fork":false,"pushed_at":"2025-04-10T21:24:45.000Z","size":382,"stargazers_count":4,"open_issues_count":3,"forks_count":4,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-10T22:28:48.005Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/release-engineering.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-10T06:25:37.000Z","updated_at":"2025-04-08T07:26:49.000Z","dependencies_parsed_at":"2024-06-27T17:12:43.678Z","dependency_job_id":"5d4a469b-2514-45c4-9f05-2055e7d95fd3","html_url":"https://github.com/release-engineering/retasc","commit_stats":null,"previous_names":["release-engineering/retasc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/release-engineering%2Fretasc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/release-engineering%2Fretasc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/release-engineering%2Fretasc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/release-engineering%2Fretasc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/release-engineering","download_url":"https://codeload.github.com/release-engineering/retasc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248447600,"owners_count":21105140,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T18:15:31.423Z","updated_at":"2025-04-11T17:17:09.985Z","avatar_url":"https://github.com/release-engineering.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Coverage Status](https://coveralls.io/repos/github/release-engineering/retasc/badge.svg?branch=main)](https://coveralls.io/github/release-engineering/retasc?branch=main)\n\n# Release Task Schedule Curator (ReTaSC)\n\nReTaSC is an app that plans product release work in Jira based on schedules in\nProduct Pages (PP).\n\n## Introduction\n\nReTaSC is meant to run as a batch job regularly to monitor schedules in PP and\ncreate or update Jira issues according to custom rules and Jira templates.\n\nReTaSC creates and manages Jira issues until resolved. This means that if a PP\nschedule or a rule changes, the related unresolved Jira issues are also updated\nand even closed.\n\n## Tasks, Rules and Prerequisites\n\nTasks are objects managed by ReTaSC. Each Task is related to a specific Rule\nand a Product Release (an identifier in PP).\n\nRules describe prerequisites to manage a Product Release.\n\nPrerequisites are requirements that enhance template parameters and can block\nTask completion if some conditions are not met. Here are some pre-defined\nprerequisites:\n\n- PP schedule item name, for example:\n  `schedule_task: \"GA for rhel {{ major }}.{{ minor }}\"`\n- a target date, for example: `target_date: \"start_date - 3|weeks\"`\n- a condition, for example: `condition: \"major \u003e= 10\"`\n- reference to other Rule that must be in Completed state\n- Jira issue templates - the issues are created only if none of the previous\n  prerequisites are in Pending state\n\nTask state can be one of:\n\n- Pending (if some prerequisites are in Pending)\n- InProgress (if some prerequisites are in InProgress but none are Pending)\n- Completed (if all prerequisites are Completed)\n\n## Rule Examples\n\n### Simple Rule for New Product Releases\n\nHere is an example of a single rule that would make sure that Jira issues\nexists for specific releases in Product Pages:\n\n```yaml\nname: New RHEL release\n\n# version of the rule schema\nversion: 1\n\n# inputs for tasks created from this rule\ninputs:\n  # The input here is \"rhel\" product in Product Pages.\n  # One task will be created for each active release of the product.\n  - product: rhel\n\n# prerequisites are processed in the given order\nprerequisites:\n  # The following condition skips releases with version less than 10.1.\n  # For example, for rhel-9.2, the no other prerequisites would be processed,\n  # and the task would be marked as Pending.\n  - condition: \"(10, 1) \u003c= (major, minor)\"\n\n  # Require schedule task with \"GA\" name to be defined (for all releases\n  # rhel-10.1 and up). This also sets a few variables for templating engine,\n  # mainly \"start_date\" and \"end_date\".\n  - schedule_task: \"GA\"\n\n  # Avoid processing further prerequisites if the target date is not reached,\n  # or the schedule task is marked as draft (this can be overridden with\n  # \"ignore_drafts\"). Processing would continue 8 weeks before the start date\n  # in \"GA\" schedule (and the schedule is not draft).\n  - target_date: \"start_date - 8|weeks\"\n\n  # This would create and manage Jira issues (main one and sub tasks) until\n  # the main issue one is resolved.\n  - jira_issue: rhel_config\n    # Jira issue fields are defined in Jinja2 template (the file path is\n    # relative to \"jira_template_path\" in configuration).\n    template: \"rhel/rhel_config.yml.j2\"\n    # The fields can be also defined or overridden here (both \"template\" and\n    # \"fields\" are optional).\n    fields:\n      labels:\n        - releng\n    subtasks:\n      - id: rhelwf-release-handoff-{{ release }}\n        template: \"rhelwf/new-rhel-release/set-up-rhel-release-phase1-accept-handoff.yml.j2\"\n        fields:\n          priority:\n            name: Normal\n\n  # After creating Jira issues, the task is marked as InProgress until the main Jira\n  # issue is resolved. After that, the task is marked as Completed.\n```\n\nUsing the rule above, ReTaSC would create a Jira issue (and a subtask) after\n`target_date` and update it whenever some fields change in the template.\n\nReTaSC sets a unique label for the Jira issues, to find it later without\nstoring any extra information. The label is constructed using\n\"jira_label_prefix\" configuration, \"jira_issue\" from the prerequisite and\n\"jira_label_suffix\" template variable originating from the Product pages input.\n\n## Environment Variables\n\nBelow is list of environment variables supported by the application and in the\ncontainer image:\n\n- `RETASC_CONFIG` - Path to the main configuration file\n- `RETASC_JIRA_TOKEN` - Jira access token\n- `RETASC_LOGGING_CONFIG` - Path to JSON file with the logging configuration;\n  see details in [Configuration dictionary\n  schema](https://docs.python.org/3/library/logging.config.html#logging-config-dictschema)\n- `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` - OpenTelemetry exporter endpoint; if\n  unset (default), traces are not exported; for example:\n  `https://jaeger.example.com:4318/v1/traces`\n- `OTEL_EXPORTER_SERVICE_NAME` - service name for OpenTelemetry; if unset\n  (default), traces are not exported\n\n## Validate Rule Files\n\nThe ReTaSC project includes a validator to ensure that rule files are correctly\nformatted and adhere to the expected schema (see the section below).\n\nExample of validating rule files with CLI:\n\n```bash\nexport RETASC_CONFIG=examples/config.yaml\n\n# validate all rules in a path recursively\nretasc validate-rules examples/rules\n\n# or validate single file\nretasc validate-rules examples/rules/rules.yaml\n```\n\n## Generate Schema Files\n\nExamples of generating YAML and JSON schema for rule and configuration files:\n\n```\nretasc generate-schema rule_schema.yaml\nretasc generate-schema --json rule_schema.json\nretasc generate-schema --config --json config.json\n```\n\n## Development\n\nThis section lists useful commands to help with ReTaSC development.\n\nInstall pre-commit locally:\n\n```\npre-commit install\n```\n\nCreating a new commit or amending an existing commit may cause the pre-commit\nto fail. In many cases pre-commit automatically fixes formatting and you can\nrun the command again:\n\n```\n\u003e git commit --ammend --no-edit\n...\nautoflake................................................................Failed\n- hook id: autoflake\n- files were modified by this hook\n...\n\n\u003e git commit --ammend --no-edit\n...\nautoflake................................................................Passed\n...\n```\n\nRun tests and additional linters:\n\n```\ntox\n```\n\nInspect specific test failure:\n\n```\ntox -e py3 -- --no-cov -lvvvvsxk test_init_tracing_with_valid_config\n```\n\nInstall poetry with [pipx]:\n\n```\n# On macOS\nbrew install pipx\npipx ensurepath\n\n# On Fedora\nsudo dnf install pipx\npipx ensurepath\n\n# Install poetry\npipx install poetry\n```\n\nInstall and run the app to virtualenv with [Poetry]:\n\n```\npoetry install\npoetry run retasc --help\n```\n\nClean up the virtualenv (can be useful after larger host system updates):\n\n```\npoetry env remove --all\n```\n\nIf you are not familiar with those please watch this [Tutorial] to have some ideas on what are\npoetry, pre-commit, flake, tox, etc...\n\n[pipx]: https://pipx.pypa.io/stable/\n[Poetry]: https://python-poetry.org/docs/\n[Tutorial]: https://www.linkedin.com/learning/create-an-open-source-project-in-python\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frelease-engineering%2Fretasc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frelease-engineering%2Fretasc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frelease-engineering%2Fretasc/lists"}