Skip to content

GH Action to publish and create core id's on merge to main #6

@gerrycampion

Description

@gerrycampion

The repo where these actions will run is being created in this ticket: #8
(It will not be stored in the cdisc-rules-engine repository.)

The workflow will be triggered by push to main.
The new repository will be a set of folders where each folder's name will be a CORE-ID like CORE-000001 (zero-padded 6 digit number). Within each directory will be a rule yaml file.
The workflow should:

  • Create a non-recursive list of NEW_DIRECTORIES from the branch being pushed (use tj-actions/changed-files)
  • Create a list of COREIDS containing all existing CORE-ID directory names in the main branch
  • Pass these lists to a "publish" python script, that does the following for each NEW_DIRECTORIES:
    • If the directory name already has a CORE-ID format, skip
    • Otherwise, calculate CORE-ID using one of these two algorithm (implement both so that we can select the preferred default at a later time). For now, use the min next id algorithm:
      • Min next id algorithm - for example, given CORE-000001, CORE-000002, CORE-000004, min next would be CORE-000003
      • Max next id algorithm - for example, given CORE-000001, CORE-000002, CORE-000004, max next id would be CORE-000005
    • Change the rule yaml by setting the status to Published and setting the new core id (currently done here)
    • Rename the rule directory name to the generated CORE-ID
    • Add the new CORE-ID to COREIDS
  • Push the update if there are any changes

Publishing is currently done by the Rule Editor here

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions