From 244f766762ef40931506fb06951c22eb06febd8d Mon Sep 17 00:00:00 2001 From: zhiren Date: Tue, 18 Mar 2025 10:44:55 -0400 Subject: [PATCH 01/12] embed the compatible table into README.md --- .../workflows/update_compatible_version.yml | 18 +++++++++++++++++- README.md | 4 ++++ docs/compatible_version.md | 3 --- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update_compatible_version.yml b/.github/workflows/update_compatible_version.yml index 0c6c3f35..7538255e 100644 --- a/.github/workflows/update_compatible_version.yml +++ b/.github/workflows/update_compatible_version.yml @@ -39,11 +39,27 @@ jobs: # Append new entry echo "| $LATEST_CLI_VERSION | $CLI_VERSION | $COMPATIBLE_VERSION |" >> docs/compatible_version.md + - name: Embed Compatible Versions into README + run: | + # Define markers for replacement + START_MARKER="" + END_MARKER="" + + # Extract current README before marker + awk -v start="$START_MARKER" -v end="$END_MARKER" ' + $0 == start {print $0; system("cat docs/compatible_version.md"); next} + $0 == end {printed=1} + !printed + ' README.md > README_UPDATED.md + + # Replace README with updated version + mv README_UPDATED.md README.md + - name: Commit and Push Changes run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" - git add docs/compatible_version.md + git add docs/compatible_version.md README.md git commit -m "Updated docs/compatible_version.md with PR #${{ github.event.pull_request.number }}" git push continue-on-error: true # Avoid breaking workflow if no changes detected diff --git a/README.md b/README.md index 9d968c54..cfbc4376 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,10 @@ Command line tool that allows the user to execute data operations on the platfor | 3.15.1 | 2.14.2 | 2.14.2 | | 3.15.2 | 2.15 | 2.15 | + + + + ### Build Instructions 1. Each system has its own credential, so building should be done after the updated the env file. 2. Run build commands for your system. diff --git a/docs/compatible_version.md b/docs/compatible_version.md index 8f10928a..a034e59b 100644 --- a/docs/compatible_version.md +++ b/docs/compatible_version.md @@ -1,5 +1,2 @@ | Cli Version | Pilot Release Version | Compatible Version | |----------|----------|----------| -| Unknown | Unknown | Unknown | -| Unknown | Unknown | Unknown | -| Unknown | 2.15 | 2.15 | From 36dd85c1a13f8d60e778b26c58f5a9477af17361 Mon Sep 17 00:00:00 2001 From: zhiren Date: Tue, 18 Mar 2025 11:29:22 -0400 Subject: [PATCH 02/12] add pipeline to add version in cli binary release --- .github/workflows/build-and-publish.yml | 50 +++++++++++++++++-- .../workflows/update_compatible_version.yml | 16 +++--- pyproject.toml | 2 +- 3 files changed, 57 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index fca31514..c1eb9211 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -9,10 +9,11 @@ on: - completed push: branches: + - testing - main jobs: - extract-branch-name: + pre-build-setup: runs-on: ubuntu-20.04 outputs: branch: ${{steps.extract_branch.outputs.branch}} @@ -22,9 +23,47 @@ jobs: shell: bash run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT + - name: Extract PR Summary and Versions + id: extract_content + run: | + PR_BODY="${{ github.event.pull_request.body }}" + + # Extract Summary + echo "$PR_BODY" | awk '/## Summary/{flag=1; next} /^## /{flag=0} flag' > PR_SUMMARY.md + echo "" >> PR_SUMMARY.md + + # Extract Versions + echo "$PR_BODY" | awk '/## Versions/{flag=1; next} /^## /{flag=0} flag' > PR_VERSIONS.md + echo "" >> PR_VERSIONS.md + + # Read extracted content + PILOT_VERSION=$(grep -oP '(?<=- Pilot Release Version: ).*' PR_VERSIONS.md | tr -d '\r') + COMPATIBLE_VERSION=$(grep -oP '(?<=- Compatible Version: ).*' PR_VERSIONS.md | tr -d '\r') + + # Handle missing values + PILOT_VERSION=${PILOT_VERSION:-"Unknown"} + COMPATIBLE_VERSION=${COMPATIBLE_VERSION:-"Unknown"} + + # Create a structured release message + echo "## Release Notes" > RELEASE_MESSAGE.md + echo "" >> RELEASE_MESSAGE.md + echo "### Summary" >> RELEASE_MESSAGE.md + cat PR_SUMMARY.md >> RELEASE_MESSAGE.md + echo "" >> RELEASE_MESSAGE.md + echo "### Versions" >> RELEASE_MESSAGE.md + echo "- **Pilot Release Version:** $PILOT_VERSION" >> RELEASE_MESSAGE.md + echo "- **Compatible Version:** $COMPATIBLE_VERSION" >> RELEASE_MESSAGE.md + + - name: Upload Release Message as Artifact + uses: actions/upload-artifact@v4 + with: + name: release-message + path: RELEASE_MESSAGE.md + + push-binary-linux: needs: [ extract-branch-name ] - if: ${{ needs.extract-branch-name.outputs.branch == 'main' || needs.extract-branch-name.outputs.branch == 'develop'}} + if: ${{ needs.extract-branch-name.outputs.branch == 'testing' || needs.extract-branch-name.outputs.branch == 'develop'}} runs-on: ubuntu-20.04 outputs: upload_url: ${{steps.create_release.outputs.upload_url}} @@ -34,6 +73,11 @@ jobs: with: ref: ${{ needs.extract-branch-name.outputs.branch }} + - name: Download Release Message Artifact + uses: actions/download-artifact@v4 + with: + name: release-message + - name: Set up Python uses: actions/setup-python@v4 with: @@ -87,7 +131,7 @@ jobs: with: tag_name: ${{ env.TAG_VERSION }} name: Release ${{ needs.extract-branch-name.outputs.branch }} ${{ env.TAG_VERSION }} - body: ${{ github.event.head_commit.message }} + body_path: RELEASE_MESSAGE.md draft: false prerelease: false target_commitish: ${{ needs.extract-branch-name.outputs.branch }} diff --git a/.github/workflows/update_compatible_version.yml b/.github/workflows/update_compatible_version.yml index 7538255e..fdab4a44 100644 --- a/.github/workflows/update_compatible_version.yml +++ b/.github/workflows/update_compatible_version.yml @@ -41,16 +41,18 @@ jobs: - name: Embed Compatible Versions into README run: | - # Define markers for replacement + # Extract content before and after markers START_MARKER="" END_MARKER="" + BEFORE=$(awk "/$START_MARKER/ {print; exit}" README.md) + AFTER=$(awk "/$END_MARKER/ {p=1} p" README.md) - # Extract current README before marker - awk -v start="$START_MARKER" -v end="$END_MARKER" ' - $0 == start {print $0; system("cat docs/compatible_version.md"); next} - $0 == end {printed=1} - !printed - ' README.md > README_UPDATED.md + # Rebuild README with updated version table + { + echo "$BEFORE" + cat docs/compatible_version.md + echo "$AFTER" + } > README_UPDATED.md # Replace README with updated version mv README_UPDATED.md README.md diff --git a/pyproject.toml b/pyproject.toml index d1153397..08d6ca28 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "app" -version = "3.15.2" +version = "3.17.0" description = "This service is designed to support pilot platform" authors = ["Indoc Systems"] From e0a739e7bd11c8cde4dd491729363b120902bd9c Mon Sep 17 00:00:00 2001 From: zhiren Date: Tue, 18 Mar 2025 11:40:46 -0400 Subject: [PATCH 03/12] fixup the table will truncate the readme --- .github/workflows/build-and-publish.yml | 18 +++++++++--------- .../workflows/update_compatible_version.yml | 9 ++++++--- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index c1eb9211..638c02e6 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -62,8 +62,8 @@ jobs: push-binary-linux: - needs: [ extract-branch-name ] - if: ${{ needs.extract-branch-name.outputs.branch == 'testing' || needs.extract-branch-name.outputs.branch == 'develop'}} + needs: [ pre-build-setup ] + if: ${{ needs.pre-build-setup.outputs.branch == 'testing' || needs.pre-build-setup.outputs.branch == 'develop'}} runs-on: ubuntu-20.04 outputs: upload_url: ${{steps.create_release.outputs.upload_url}} @@ -71,7 +71,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 with: - ref: ${{ needs.extract-branch-name.outputs.branch }} + ref: ${{ needs.pre-build-setup.outputs.branch }} - name: Download Release Message Artifact uses: actions/download-artifact@v4 @@ -130,24 +130,24 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token with: tag_name: ${{ env.TAG_VERSION }} - name: Release ${{ needs.extract-branch-name.outputs.branch }} ${{ env.TAG_VERSION }} + name: Release ${{ needs.pre-build-setup.outputs.branch }} ${{ env.TAG_VERSION }} body_path: RELEASE_MESSAGE.md draft: false prerelease: false - target_commitish: ${{ needs.extract-branch-name.outputs.branch }} + target_commitish: ${{ needs.pre-build-setup.outputs.branch }} files: | ./app/bundled_app/linux/pilotcli_linux ./app/bundled_app/linux/pilotcli_cloud push-binary-macos: needs: [ push-binary-linux ] - if: ${{ needs.extract-branch-name.outputs.branch == 'main' || needs.extract-branch-name.outputs.branch == 'develop'}} + if: ${{ needs.pre-build-setup.outputs.branch == 'main' || needs.pre-build-setup.outputs.branch == 'develop'}} runs-on: macos-13 steps: - name: Checkout repository uses: actions/checkout@v3 with: - ref: ${{ needs.extract-branch-name.outputs.branch }} + ref: ${{ needs.pre-build-setup.outputs.branch }} - name: Set up Python uses: actions/setup-python@v4 @@ -192,13 +192,13 @@ jobs: push-binary-windows: needs: [ push-binary-linux ] - if: ${{ needs.extract-branch-name.outputs.branch == 'main' || needs.extract-branch-name.outputs.branch == 'develop'}} + if: ${{ needs.pre-build-setup.outputs.branch == 'main' || needs.pre-build-setup.outputs.branch == 'develop'}} runs-on: windows-2022 steps: - name: Checkout repository uses: actions/checkout@v3 with: - ref: ${{ needs.extract-branch-name.outputs.branch }} + ref: ${{ needs.pre-build-setup.outputs.branch }} - name: Set up Python uses: actions/setup-python@v4 diff --git a/.github/workflows/update_compatible_version.yml b/.github/workflows/update_compatible_version.yml index fdab4a44..09264cfa 100644 --- a/.github/workflows/update_compatible_version.yml +++ b/.github/workflows/update_compatible_version.yml @@ -41,16 +41,19 @@ jobs: - name: Embed Compatible Versions into README run: | - # Extract content before and after markers + # Define markers START_MARKER="" END_MARKER="" - BEFORE=$(awk "/$START_MARKER/ {print; exit}" README.md) - AFTER=$(awk "/$END_MARKER/ {p=1} p" README.md) + + BEFORE=$(awk "/$START_MARKER/ {exit} {print}" README.md) + AFTER=$(awk "/$END_MARKER/ {found=1; next} found {print}" README.md) # Rebuild README with updated version table { echo "$BEFORE" + echo "$START_MARKER" cat docs/compatible_version.md + echo "$END_MARKER" echo "$AFTER" } > README_UPDATED.md From 5f6abfeb3bd275ad8c769cecab5762992a44a8fb Mon Sep 17 00:00:00 2001 From: zhiren Date: Tue, 18 Mar 2025 11:59:33 -0400 Subject: [PATCH 04/12] add PR related in build and publish --- .github/workflows/build-and-publish.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 010cb13c..1bcc5eec 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -12,9 +12,17 @@ on: - testing - main + pull_request: + branches: + - testing # Triggers only when PR is merged into `testing` + types: + - closed + jobs: pre-build-setup: runs-on: ubuntu-20.04 + if: github.event.pull_request.merged == true # Runs only if PR is merged + outputs: branch: ${{steps.extract_branch.outputs.branch}} steps: From 4e03a1a1b2bf60d89350628b4e0ec6654f560735 Mon Sep 17 00:00:00 2001 From: zhiren Date: Tue, 18 Mar 2025 12:18:58 -0400 Subject: [PATCH 05/12] remove the testing branch --- .github/workflows/build-and-publish.yml | 5 +---- .github/workflows/update_compatible_version.yml | 9 +++++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 1bcc5eec..4e8792cf 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -9,12 +9,9 @@ on: - completed push: branches: - - testing - main pull_request: - branches: - - testing # Triggers only when PR is merged into `testing` types: - closed @@ -71,7 +68,7 @@ jobs: push-binary-linux: needs: [ pre-build-setup ] - if: ${{ needs.pre-build-setup.outputs.branch == 'testing' || needs.pre-build-setup.outputs.branch == 'develop'}} + if: ${{ needs.pre-build-setup.outputs.branch == 'main' || needs.pre-build-setup.outputs.branch == 'develop'}} runs-on: ubuntu-20.04 outputs: upload_url: ${{steps.create_release.outputs.upload_url}} diff --git a/.github/workflows/update_compatible_version.yml b/.github/workflows/update_compatible_version.yml index 09264cfa..bbf91446 100644 --- a/.github/workflows/update_compatible_version.yml +++ b/.github/workflows/update_compatible_version.yml @@ -1,9 +1,14 @@ name: Update Compatible Versions on: - pull_request: + workflow_run: + workflows: [ "Build and Publish" ] branches: - - testing # Triggers only when PR is merged into `testing` + - develop + types: + - completed + + pull_request: types: - closed # Ensures it runs only on PR closure (merge) From 38f318f6bdcaf627ef750b122183efabaf0bf7ea Mon Sep 17 00:00:00 2001 From: Color Zhan Date: Tue, 18 Mar 2025 15:48:31 -0400 Subject: [PATCH 06/12] Pilot 7101: Update the message of new version notification (#210) * build on testing * build on testing * remove the testing code * update new version notification * remove the testing pipeline --- app/services/output_manager/message_handler.py | 16 ++++++++++------ app/utils/aggregated.py | 13 ++++++++----- pyproject.toml | 2 +- tests/app/commands/test_user.py | 16 +++------------- 4 files changed, 22 insertions(+), 25 deletions(-) diff --git a/app/services/output_manager/message_handler.py b/app/services/output_manager/message_handler.py index e188c2b9..56af96cb 100644 --- a/app/services/output_manager/message_handler.py +++ b/app/services/output_manager/message_handler.py @@ -353,12 +353,16 @@ def container_registry_share_project_success(role, project, username): @staticmethod def newer_version_available(version, download_url, print_message=True): - clickable_text = f'\033]8;;{download_url}\033\\latest cli version\033]8;;\033\\' - message = ( - f'\nNewer version available! Pilotcli v{version} is available. Please vist \n{clickable_text}. ' - 'This link will expire in 10 minutes. If the link doesn\'t show up, Please visit the \n' - 'support page on portal to download the latest version.' - ) + message = f""" +🚀 **Newer Version Available!** +**Pilotcli v{version}** is now available. + +🔗 **Download Here:** +[Linux Version (v{version})]({download_url}) + +⏳ **Note:** This link will expire in **10 minutes**. +If the download link doesn’t work, please visit the **support page** on the portal to get the latest version. +""" if print_message: logger.warning(message) diff --git a/app/utils/aggregated.py b/app/utils/aggregated.py index b70037dc..b00653c0 100644 --- a/app/utils/aggregated.py +++ b/app/utils/aggregated.py @@ -16,7 +16,6 @@ import app.services.logger_services.log_functions as logger from app.configs.app_config import AppConfig -from app.configs.user_config import UserConfig from app.models.item import ItemStatus from app.models.item import ItemType from app.services.clients.base_auth_client import BaseAuthClient @@ -234,13 +233,17 @@ def remove_the_output_file(filepath: str) -> None: def get_latest_cli_version() -> Tuple[Version, str]: + ''' + Summary: + Get the latest version of the CLI and download link + from backend. + Returns: + - latest_version(Version): the latest version of the CLI + - download_url(str): the download link of the CLI + ''' try: httpx_client = BaseClient(AppConfig.Connections.url_fileops_greenroom) - user_config = UserConfig() - if not user_config.is_access_token_exists(): - return Version('0.0.0') - headers = {'Authorization': 'Bearer'} response = httpx_client._get('v1/download/cli/presigned', headers=headers) result = response.json().get('result', {}) diff --git a/pyproject.toml b/pyproject.toml index d1153397..597588a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "app" -version = "3.15.2" +version = "3.16.0" description = "This service is designed to support pilot platform" authors = ["Indoc Systems"] diff --git a/tests/app/commands/test_user.py b/tests/app/commands/test_user.py index bcd26e1f..877ea615 100644 --- a/tests/app/commands/test_user.py +++ b/tests/app/commands/test_user.py @@ -93,13 +93,12 @@ def test_login_command_with_newer_version_available_message( api_key = fake.pystr(20) monkeypatch.setenv('PILOT_API_KEY', api_key) login_using_api_key_mock = mocker.patch('app.commands.user.login_using_api_key', return_value=True) - access_token_exists = mocker.patch('app.utils.aggregated.UserConfig.is_access_token_exists', return_value=True) download_url = fake.url() httpx_mock.add_response( url=AppConfig.Connections.url_fileops_greenroom + '/v1/download/cli/presigned', status_code=200, - json={'result': {'linux': {'version': new_version, 'url': download_url}}}, + json={'result': {'linux': {'version': new_version, 'download_url': download_url}}}, ) mocker.patch('pkg_resources.get_distribution', return_value=mocker.Mock(version=current_version)) @@ -107,17 +106,12 @@ def test_login_command_with_newer_version_available_message( assert result.exit_code == 0 assert login_using_api_key_mock.called_once_with(api_key) - assert access_token_exists.called_once() if Version(current_version) < Version(new_version): - clickable_text = f'\033]8;;{download_url}\033\\latest cli version\033]8;;\033\\' - expected_message = result.output.replace( - '\x1b]8;;\x1b\\latest cli version\x1b]8;;\x1b\\', clickable_text - ).strip() - actual_message = mhandler.SrvOutPutHandler.newer_version_available( + except_message = mhandler.SrvOutPutHandler.newer_version_available( new_version, download_url, print_message=False ) - assert actual_message.strip() == expected_message.split('\n\n')[1].strip() + assert except_message in result.output # nothing should be printed out @@ -125,7 +119,6 @@ def test_login_command_when_url_link_fails(mocker, cli_runner, fake, monkeypatch api_key = fake.pystr(20) monkeypatch.setenv('PILOT_API_KEY', api_key) mocker.patch('app.commands.user.login_using_api_key', return_value=True) - access_token_exists = mocker.patch('app.utils.aggregated.UserConfig.is_access_token_exists', return_value=True) httpx_mock.add_response( url=AppConfig.Connections.url_fileops_greenroom + '/v1/download/cli/presigned', @@ -136,7 +129,6 @@ def test_login_command_when_url_link_fails(mocker, cli_runner, fake, monkeypatch result = cli_runner.invoke(login) assert result.exit_code == 0 - assert access_token_exists.called_once() # nothing should be printed out @@ -144,9 +136,7 @@ def test_help_command_without_login(mocker, cli_runner, fake, monkeypatch, httpx api_key = fake.pystr(20) monkeypatch.setenv('PILOT_API_KEY', api_key) mocker.patch('app.commands.user.login_using_api_key', return_value=True) - access_token_exists = mocker.patch('app.utils.aggregated.UserConfig.is_access_token_exists', return_value=True) mocker.patch('pkg_resources.get_distribution', return_value=mocker.Mock(version='1.0.0')) result = cli_runner.invoke(login) assert result.exit_code == 0 - assert access_token_exists.called_once() From d0966ceb7ddff6e87560f65178ed4fbde78b258e Mon Sep 17 00:00:00 2001 From: zhiren Date: Wed, 19 Mar 2025 11:13:00 -0400 Subject: [PATCH 07/12] update compatible version as NDJSON format for later api design --- .../workflows/update_compatible_version.yml | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/update_compatible_version.yml b/.github/workflows/update_compatible_version.yml index bbf91446..5d5f7b59 100644 --- a/.github/workflows/update_compatible_version.yml +++ b/.github/workflows/update_compatible_version.yml @@ -25,7 +25,6 @@ jobs: id: extract_versions run: | PR_BODY="${{ github.event.pull_request.body }}" - echo "$PR_BODY" # Extract the "## Versions" section echo "$PR_BODY" | awk '/## Versions/{flag=1; next} /^## /{flag=0} flag' > PR_VERSIONS.md @@ -41,8 +40,14 @@ jobs: # Get the latest Git tag (assuming it's the CLI version) LATEST_CLI_VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "Unknown") - # Append new entry - echo "| $LATEST_CLI_VERSION | $CLI_VERSION | $COMPATIBLE_VERSION |" >> docs/compatible_version.md + # Convert to NDJSON format + NEW_ENTRY="{\"Cli Version\": \"$LATEST_CLI_VERSION\", \"Pilot Release Version\": \"$CLI_VERSION\", \"Compatible Version\": \"$COMPATIBLE_VERSION\"}" + + # Ensure file exists before appending + touch docs/compatible_version.ndjson + + # Append new entry to NDJSON file + echo "$NEW_ENTRY" >> docs/compatible_version.ndjson - name: Embed Compatible Versions into README run: | @@ -50,14 +55,20 @@ jobs: START_MARKER="" END_MARKER="" + # Extract the content before the marker BEFORE=$(awk "/$START_MARKER/ {exit} {print}" README.md) AFTER=$(awk "/$END_MARKER/ {found=1; next} found {print}" README.md) - # Rebuild README with updated version table + # Convert NDJSON to Markdown Table Format for README + echo "| Cli Version | Pilot Release Version | Compatible Version |" > version_table.md + echo "|------------|----------------------|---------------------|" >> version_table.md + cat docs/compatible_version.ndjson | jq -r '. | "| \(.["Cli Version"]) | \(.["Pilot Release Version"]) | \(.["Compatible Version"]) |"' >> version_table.md + + # Rebuild README with updated version section { echo "$BEFORE" echo "$START_MARKER" - cat docs/compatible_version.md + cat version_table.md echo "$END_MARKER" echo "$AFTER" } > README_UPDATED.md @@ -69,7 +80,7 @@ jobs: run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" - git add docs/compatible_version.md README.md - git commit -m "Updated docs/compatible_version.md with PR #${{ github.event.pull_request.number }}" + git add docs/compatible_version.ndjson README.md + git commit -m "Updated docs/compatible_version.ndjson with PR #${{ github.event.pull_request.number }}" git push continue-on-error: true # Avoid breaking workflow if no changes detected From 35f2924fa3baecfaac16d8f39e2283b2bed68339 Mon Sep 17 00:00:00 2001 From: zhiren Date: Wed, 19 Mar 2025 11:21:15 -0400 Subject: [PATCH 08/12] update compatible version as NDJSON format for later api design --- docs/compatible_version.md | 5 ----- docs/compatible_version.ndjson | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) delete mode 100644 docs/compatible_version.md create mode 100644 docs/compatible_version.ndjson diff --git a/docs/compatible_version.md b/docs/compatible_version.md deleted file mode 100644 index de6242ce..00000000 --- a/docs/compatible_version.md +++ /dev/null @@ -1,5 +0,0 @@ -| Cli Version | Pilot Release Version | Compatible Version | -|----------|----------|----------| -| 3.15.0 | 2.14.2 | 2.14.2 | -| 3.15.1 | 2.14.2 | 2.14.2 | -| 3.15.2 | 2.15 | 2.15 | diff --git a/docs/compatible_version.ndjson b/docs/compatible_version.ndjson new file mode 100644 index 00000000..fc54b268 --- /dev/null +++ b/docs/compatible_version.ndjson @@ -0,0 +1,5 @@ +{"Cli Version": "3.15.0", "Pilot Release Version": "2.14.2", "Compatible Version": "2.14.2"} +{"Cli Version": "3.15.1", "Pilot Release Version": "2.14.2", "Compatible Version": "2.14.2"} +{"Cli Version": "3.15.2", "Pilot Release Version": "2.15", "Compatible Version": "2.15"} +{"Cli Version": "3.16.0", "Pilot Release Version": "2.15", "Compatible Version": "2.15"} +{"Cli Version": "3.17.0", "Pilot Release Version": "2.15", "Compatible Version": "2.15"} From 2160733b26869af7812b5c0e5d777a925dde3482 Mon Sep 17 00:00:00 2001 From: zhiren Date: Mon, 24 Mar 2025 00:29:57 -0400 Subject: [PATCH 09/12] testing --- .github/workflows/build-and-publish.yml | 6 +++++- .github/workflows/run-tests.yml | 1 + .github/workflows/update_compatible_version.yml | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 4e8792cf..b7bb6d07 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -5,6 +5,7 @@ on: workflows: [ "Run Tests" ] branches: - develop + - testing types: - completed push: @@ -12,6 +13,9 @@ on: - main pull_request: + branches: + - develop + - testing types: - closed @@ -68,7 +72,7 @@ jobs: push-binary-linux: needs: [ pre-build-setup ] - if: ${{ needs.pre-build-setup.outputs.branch == 'main' || needs.pre-build-setup.outputs.branch == 'develop'}} + if: ${{ needs.pre-build-setup.outputs.branch == 'testing' || needs.pre-build-setup.outputs.branch == 'develop'}} runs-on: ubuntu-20.04 outputs: upload_url: ${{steps.create_release.outputs.upload_url}} diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index a67bcff6..01814e02 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -4,6 +4,7 @@ on: push: branches: - develop + - testing pull_request: branches: - main diff --git a/.github/workflows/update_compatible_version.yml b/.github/workflows/update_compatible_version.yml index 5d5f7b59..0fc96c1f 100644 --- a/.github/workflows/update_compatible_version.yml +++ b/.github/workflows/update_compatible_version.yml @@ -5,6 +5,7 @@ on: workflows: [ "Build and Publish" ] branches: - develop + - testing types: - completed From 0580665ee8ba5c71ce4ed5f85e2f8ff968d2e739 Mon Sep 17 00:00:00 2001 From: zhiren Date: Mon, 24 Mar 2025 00:30:15 -0400 Subject: [PATCH 10/12] testing --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3848a6f6..b884edb6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "app" -version = "3.17.1" +version = "3.18.0" description = "This service is designed to support pilot platform" authors = ["Indoc Systems"] From 3e181576c018cea1912834c3f899d639aec998d2 Mon Sep 17 00:00:00 2001 From: zhiren Date: Mon, 24 Mar 2025 00:43:04 -0400 Subject: [PATCH 11/12] use poetry to check version --- .github/workflows/update_compatible_version.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update_compatible_version.yml b/.github/workflows/update_compatible_version.yml index 0fc96c1f..51e17245 100644 --- a/.github/workflows/update_compatible_version.yml +++ b/.github/workflows/update_compatible_version.yml @@ -39,7 +39,7 @@ jobs: COMPATIBLE_VERSION=${COMPATIBLE_VERSION:-"Unknown"} # Get the latest Git tag (assuming it's the CLI version) - LATEST_CLI_VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "Unknown") + LATEST_CLI_VERSION=$(poetry version --short || echo "Unknown") # Convert to NDJSON format NEW_ENTRY="{\"Cli Version\": \"$LATEST_CLI_VERSION\", \"Pilot Release Version\": \"$CLI_VERSION\", \"Compatible Version\": \"$COMPATIBLE_VERSION\"}" From 7c5579820e6d86afecec660cb958443fff7fdb65 Mon Sep 17 00:00:00 2001 From: zhiren Date: Mon, 24 Mar 2025 00:43:19 -0400 Subject: [PATCH 12/12] bumpup version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b884edb6..d1532d60 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "app" -version = "3.18.0" +version = "3.18.1a0" description = "This service is designed to support pilot platform" authors = ["Indoc Systems"]