Collect changelog

 

Explanation:

  1. Clone GitHub platform-complete repository: The job starts by cloning the repository from GitHub.

  2. Get diff between the current and previous commit: Pipeline compares the current commit hash with the previous build's commit hash.

  3. If no changes are detected, Jenkins aborts the pipeline.

  4. If differences are found in the install.json file, Pipeline reads the modules with changed versions and saves them to a list (ex: changeList).

  5. Extract minor versions from module id: Pipeline converts the list into a map(object) with module names and versions.

    1. For backend and edge modules minor version in the snapshot branch is the last digits after SNAPSHOT. For example mod-a-1.2.3-SNAPSHOT.49

    2. For ui modules minor version in the snapshot branch is the last digits after zeros For example mod-a-1.2.3000049

This minor version is the number of build in Jenkins and GitHub action respectively

[ { "name": "mod-a", "version": "1.2.3-SNAPSHOT.49", "minorVersion": "49", "changeCommit": "", "changeHash": "" }, { "name": "foio_a", "version": "1.2.30000049", "minorVersion": "49", "changeCommit": "", "changeHash": "" } ]
  1. Collect changelog:

    1. For each module, if it starts with mod- or edge-, the pipeline gets the change message and commit hash from the module Jenkins job object by build number (minor version).

    2. If the module starts with folio_, the pipeline gets the change message and commit hash from the module workflow build (GitHub actions) by build number (minor version).

[ { "name": "mod-a", "version": "1.2.3-SNAPSHOT.49", "minorVersion": "49", "changeCommit": "32c51e18c39d9eb2a1b95b33652f14a1b14a39ef", "changeHash": "[MODA] Some change" }, { "name": "foio_a", "version": "1.2.30000049", "minorVersion": "49", "changeCommit": "32c51e18c39d9eb2ab876ab567ab576a5b67ab56", "changeHash": "[UIA] Some change" } ]
  1. Continue the pipeline with the existing flow (provision environments and run tests)

  2. End Pipeline: Send Slack notification with attached changelog