YuriiShynbuievIOHK
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    1
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Identus Platform CI ## Common definitions of the terms in the CI ### Build A build refers to compiling source code into binary code that will be distributed and executed on a machine (local or cloud environment). It includes compiling, linking, and packaging the application. In the Continuous Integration (CI) context, a build is triggered automatically whenever changes are pushed to the code repository. The build process may include running automated tests to ensure the new code doesn't break existing functionality. ### Publishing Publishing is the process of distributing compiled software artifacts (like libraries, packages, or applications) to a repository or registry where others can access and use them. For example, in a CI pipeline, publishing may involve uploading a package to a package manager (like npm, GitHub Packages, Maven Central, Helm Chart registry, or Docker registry). It makes the artifact available for downstream processes. ### Deployment Deployment is moving the built and tested software to a live environment where end-users can access and use it. It typically involves copying and updating the Helm Chart of the corresponding component, setting up the necessary environment, and configuring the application. In a CI/CD pipeline, deployment is often automated and can be triggered by successful builds or passing tests. Two environments are used for the automated distribution of the Cloud-Agent and the Mediator services: DEV and SIT. Automated deployment of the latest component version to the DEV environment is essential to the CI process. It's performed by distributing the docker image of the service and updating the Helm chart. Argo CD is configured to track the correct version of the component according to the [Tracking Deployment Strategies](https://argo-cd.readthedocs.io/en/stable/user-guide/tracking_strategies/) configuration of the Argo CD state. ### Release A release is the distribution of a specific version of software to end-users. It marks the point where the software is considered stable and ready for use. A release includes release notes, changelog, dependencies, the corresponding version of the Open API specification, and other important artifacts and is often tied to a milestone or feature set. In CI/CD, a release is a formal process that includes tagging the codebase, generating release artifacts, and possibly notifying users or stakeholders. //TODO: add the reference to the release documentation that includes the list of the assets and common process ### Revision Build Revision Build refers to a new software build version with minor changes or fixes, typically without significant new features. It often addresses bugs or applies minor updates to an existing release. In CI/CD, a revision build is triggered by small code changes or hotfixes and is versioned with an incremented revision number. For micro-services, the revision number is a current version of the project, the build number, and the short commit sha (for instance, 1.38.0-4-abcdefj). For the library, it's the current version of the library and short commit sha (for example, 1.2.0-abcdefj). ## Continuous Integration of the micro-services Current flow is applied to the microservices: the Cloud Agent and the Mediator. The sequence diagram below shows a more complex flow that is applied to the Cloud Agent. For each commit to the tracked branches (`main` is used by default) the `build.yml` workflows is triggered and based on the current version of the project, build number and short commit sha, the next revision version is set: - for the docker image the format is `version`-`build`-`sha` - for the Open API speficiation the version is `version`-`sha` - for the client liberaries the version is `version`-`sha` **NOTE**: - The unit, integration, e2e and performance tests are not run. It's assumed that everything that is committed to the tracked branch already passed these checks - The build number in the docker tag is required to distinguish the version update based on the increment number of each build. Build number is not required for the liraries. (the packages with a changes in the Open API specification are marked with `sha` of the revision) ```mermaid sequenceDiagram actor E as Engineer participant ICAR as identus-cloud-agent repository participant BWF as build-workflow participant RCWF as release-client-workflow participant GHCR as GitHub Packages participant APHC as atala-prism-helm-charts repository participant ArgoCD as ArgoCD participant DEV as DEV E ->> ICAR: merge PR Note over ICAR, APHC: Publish the docker image, clients and helm chart ICAR ->> BWF: trigger build BWF -->> BWF: build a docker image of "cloud-agent-1.35.0-N-abcdefg" BWF -) GHCR: publish a docker image BWF -->> BWF: build a revision version of the OAS BWF -->> ICAR: publish a revision version of the OAS BWF --) +RCWF: trigger release-client workflow ICAR -->> RCWF: download a published OAS RCWF -->> RCWF: build clients (TS, Kotlin) for revision version RCWF -) GHCR: publish Kotlin client RCWF -) -GHCR: publish TypeScript client BWF -) +APHC: trigger repo_dispatch "build-chart-package" Note over GHCR, DEV: Deploy revision version of the cloud-agent to the DEV APHC -->> APHC: build a new helm chart for revision version APHC -->> -APHC: commit a new package to the helm chart repository ArgoCD -->> APHC: sync the chart ArgoCD -->> DEV: apply the latest revision version for the DEV DEV -->> GHCR: fetch the image of the revision version DEV ->> DEV: sync with the helm chart ``` ## Release a new version of the Cloud-Agent or the Mediator The following flow covers three cases when the new version is released: - regular release - RC release - patch release The configuration of the semantic-release plugin contains the branch configuration section that dictates the patters of the branches and what release is it possible to do from the branch. By default, the `main` branch is used for a regular release, `beta` or `beta/*` for RC releases, and the branches with particular patters are used for the patch (`1.38.x` - for patches of 1.38.x versions, or `1.x.x` for patching all versions that match 1.x.x patternt) The following flow should be executed manually by the engineer and can be targeted the `main` branch or any release branch. Checks: - PR title follows conventional-commits - DCO - commit is signed by the GPG key - Megalinter - unit tests - e2e tests - performance tests Outputs of the flow: - a new docker image of the cloud-agent is published to GHCR - a new helm chart for the cloud-agent is published to the atala-prism-helm-charts - a new version of clients for TS and Kotlin are published to GHCR - a new version of the cloud-agent is deployed to the DEV environment - a new tag with a release version is pushed to identus-cloud-agent repo - a chore commit with the updates is pushed to the identus-cloud-agent repo: - CHANGELOG.md - OAS specification - DEPENDENCIES.md - infrastructure/local/.env - Slack notification is sent about the successful or failed release Any type of release must be manually triggered by the engineer. The following flow shows the release process: ```mermaid sequenceDiagram actor E as Engineer participant ICAR as identus-cloud-agent repository participant RWF as release-workflow participant RCWF as release-client-workflow participant GHCR as GitHub Packages participant NPMJS as NPMJS participant APHC as atala-prism-helm-charts repository participant ArgoCD as ArgoCD participant DEV as DEV Note over ICAR, APHC: Release RC version of the cloud-agent E ->> RWF: trigger release RWF -->> +RWF: define a new RC version "cloud-agent-v1.35.0-rc.1" RWF -->> RWF: run unit tests RWF -->> RWF: run e2e tests RWF -->> RWF: run peformance tests RWF -->> RWF: build a docker image of "cloud-agent-v1.35.0-rc.1" RWF --) GHCR: publish a docker image "v1.35.0-rc.1" RWF --) ICAR: commit changelog, dependencies, OAS RWF -) APHC: trigger repo_dispatch "build-chart-package" RWF -) Slack: notify about release "v1.35.0-rc.1" RWF --) -ICAR: puch the RC tag ICAR --) RCWF: trigger release-client workflow RCWF -->> RCWF: build a version of the OAS for "v1.35.0-rc.1" RCWF -->> RCWF: build clients (TS, Kotlin) for "v1.35.0-rc.1" RCWF -) GHCR: publish Kotlin client RCWF -) NPMJS: publish TypeScript client Note over GHCR, DEV: Deploy RC version of the cloud-agent to the DEV APHC -->> APHC: build a new helm chart for "v1.35.0-rc.1" APHC -->> APHC: commit a new package to the helm chart repository ArgoCD -->> APHC: sync the chart "v1.35.0-rc.1" ArgoCD -->> DEV: apply the latest version for DEV DEV -->> GHCR: fetch the image for "v1.35.0-rc.1" DEV ->> DEV: sync with the chart "v1.35.0-rc.1" ``` ## Code Freeze of the Cloud-Agent or the Mediator Code freeze is a phase in the Software Development Life Cycle (SDLC) where no new code changes are allowed, except for critical bug fixes or essential updates. This phase is typically implemented just before a software release to stabilize the codebase, ensuring that no new issues are introduced that could jeopardize the quality or functionality of the software. ### Purpose of Code Freeze **Stabilization**: Ensures that the code is stable and all functionalities work as expected without introducing new features or changes that could potentially cause bugs or other issues. **Quality Assurance**: Allows the QA team to focus on testing the existing codebase without worrying about changes that could invalidate their tests or introduce new bugs. **Release Preparation**: Prepares the codebase for deployment by minimizing risks associated with last-minute changes. This is particularly important in ensuring that the final product meets the expected standards. **Risk Mitigation**: Reduces the likelihood of last-minute changes that could introduce critical issues, thereby lowering the risk of a delayed or problematic release. ### Code-Freeze Process **TL;DR** The main purpose of the code freeze is to isolate a stable version of the components (services and libraries) for QA activities and stabilization in a dedicated environment. This process prevents the addition of new features planned for future releases. The branch used for this isolation is beta, and the environment is SIT. **Details** The process consists of the following steps: - The team announces the beginning of the code freeze stage. - A new branch is created from the target revision (e.g., beta). - The release workflow is triggered from the beta branch: - Docker images are published. - HTTP Clients are published. - Helm Charts are published. - The RC version is deployed to the SIT environment for stabilization. - Critical fixes are applied to the beta branch. During this stage, other engineers can continue merging PRs into the main branch, running CI in the DEV environment without affecting the SIT environment. All commits to the beta branch must be merged back into the main branch. Engineers can choose to do this continuously (by creating two PRs for each change) or as a single PR at the end of the code-freeze stage. Upon completion of the code-freeze stage, the engineering team has two options for proceeding with the release: - If the main branch doesn't contain breaking changes, the changes from the beta branch are merged into the main branch, and the release workflow is triggered from the main branch. - If the main branch contains breaking changes, a new branch for the LTS release (e.g., 1.40.x) is created, and the release flow is triggered from this branch. **NOTE**: Engineering team should undestand that in the case when the release is made from the release branch, the principle `Release From Trunk` is not used. Since the builds and CI for the DEV environment are isolated from the SIT environment and the beta branch, engineers can continue working on feature branches and make builds from those branches. In this scenario, CI in the DEV environment will continue without any blockers. ## Versions The following table shows the possible versions of the assets | Build | Version | Example | | -------- | -------- | -------| | Revision | {component-version}-{build-number}-{commit-sha} | 1.39.0-45-abcd123 | | RC | {component-version}-{rc}.{index} | 1.39.0-rc.1 | | Release. | {component-version} | 1.39.0 | According to the SemVer rules: 1.39.0-rc.1 < 1.39.0-45-abcd123 < 1.39.0 ## Build Promotion Rules **TODO**: These rules must be agreed with QA team. Additional rules to guarantee compabilitility with other components and quality will be defined later. Rules: - Revision Build is promoted to the DEV environment automatically - RC Build is promoted to the DEV environment automatically - RC Build is promoted to the SIT environment automatically - Release Build is promoted to the SIT environment automatically

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully