From 8a41ee01817f056729f4d7b60d8e26fa935ad422 Mon Sep 17 00:00:00 2001 From: Ofer Affias Date: Thu, 29 May 2025 18:46:33 +0300 Subject: [PATCH] GH Action lite version --- docs/downloads/gitstream-lite.yml | 49 +++++++++++++++++++++++++++++ docs/github-installation.md | 52 +++++++++++++++++++++++++++++++ docs/troubleshooting.md | 33 ++++++++++++++++++-- 3 files changed, 132 insertions(+), 2 deletions(-) create mode 100644 docs/downloads/gitstream-lite.yml diff --git a/docs/downloads/gitstream-lite.yml b/docs/downloads/gitstream-lite.yml new file mode 100644 index 000000000..d5f6b8e02 --- /dev/null +++ b/docs/downloads/gitstream-lite.yml @@ -0,0 +1,49 @@ +# Code generated by gitStream GitHub app - DO NOT EDIT + +name: gitStream workflow automation +run-name: | + /:\ gitStream: PR #${{ fromJSON(fromJSON(github.event.inputs.client_payload)).pullRequestNumber }} from ${{ github.event.inputs.full_repository }} + +on: + workflow_dispatch: + inputs: + client_payload: + description: The Client payload + required: true + full_repository: + description: the repository name include the owner in `owner/repo_name` format + required: true + head_ref: + description: the head sha + required: true + base_ref: + description: the base ref + required: true + installation_id: + description: the installation id + required: false + resolver_url: + description: the resolver url to pass results to + required: true + resolver_token: + description: Optional resolver token for resolver service + required: false + default: '' + +jobs: + gitStream: + timeout-minutes: 15 + runs-on: ubuntu-latest + name: gitStream workflow automation + steps: + - name: Evaluate Rules + uses: linear-b/gitstream-github-action@v2-lite + id: rules-engine + with: + full_repository: ${{ github.event.inputs.full_repository }} + head_ref: ${{ github.event.inputs.head_ref }} + base_ref: ${{ github.event.inputs.base_ref }} + client_payload: ${{ github.event.inputs.client_payload }} + installation_id: ${{ github.event.inputs.installation_id }} + resolver_url: ${{ github.event.inputs.resolver_url }} + resolver_token: ${{ github.event.inputs.resolver_token }} diff --git a/docs/github-installation.md b/docs/github-installation.md index 715d4c049..62e138e9e 100644 --- a/docs/github-installation.md +++ b/docs/github-installation.md @@ -58,6 +58,32 @@ You can set up gitStream for a single repo or your entire GitHub organization. S --8<-- "docs/downloads/gitstream.yml" ``` +
+ + [:octicons-download-24: Download gitstream.yml (regular version)](/downloads/gitstream.yml){ .md-button } + + + [:octicons-download-24: Download gitstream.yml (lite version)](/downloads/gitstream-lite.yml){ .md-button } + +
+ + !!! tip "Large Repository Support (Lite Version)" + If you're working with a large repository (typically monorepos) and experience timeout issues during GitHub Actions execution, you can use the lite version of gitStream that performs a shallow clone to reduce execution time: + + ```yaml + jobs: + gitStream: + timeout-minutes: 15 + runs-on: ubuntu-latest + name: gitStream workflow automation + steps: + - name: Evaluate Rules + uses: linear-b/gitstream-github-action@v2-lite + id: rules-engine + ``` + + **Important:** The lite version has limitations - automations that rely on Git history (such as code-experts) may not work properly due to the shallow clone. + !!! Success When finished, you should have the following file structure in your repo. @@ -96,6 +122,32 @@ You can set up gitStream for a single repo or your entire GitHub organization. S --8<-- "docs/downloads/gitstream.yml" ``` +
+ + [:octicons-download-24: Download gitstream.yml (regular version)](/downloads/gitstream.yml){ .md-button } + + + [:octicons-download-24: Download gitstream.yml (lite version)](/downloads/gitstream-lite.yml){ .md-button } + +
+ + !!! tip "Large Repository Support (Lite Version)" + If you're working with large repositories in your organization (typically monorepos) and experience timeout issues during GitHub Actions execution, you can use the lite version of gitStream that performs a shallow clone to reduce execution time: + + ```yaml + jobs: + gitStream: + timeout-minutes: 15 + runs-on: ubuntu-latest + name: gitStream workflow automation + steps: + - name: Evaluate Rules + uses: linear-b/gitstream-github-action@v2-lite + id: rules-engine + ``` + + **Important:** The lite version has limitations - automations that rely on Git history (such as code-experts) may not work properly due to the shallow clone. See the [troubleshooting section](/troubleshooting/#github-timeout-issues-with-large-repositories) for more details. + !!! Success Once finished, **all** PRs to your organization's repositories will be processed by the GitHub Action in this repo, and your `cm` repo should have a file directory that looks like this. diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index b3e709b7c..bc0320b10 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -36,7 +36,7 @@ Some organizations limit which actions can run, in that case, in the repository Also, add ``` -linear-b/gitstream-github-action@v2,*/*/.github/workflows/gitstream.yml* +linear-b/gitstream-github-action@v2,linear-b/gitstream-github-action@v2-lite,*/*/.github/workflows/gitstream.yml* ``` to the **Allow specified actions and reusable workflows** list, if it is shown. ![GitHub allow marketplace actions](screenshots/github_settings_allow_specified_actions @@ -129,7 +129,7 @@ Clicking the `Details` button will show more information and context. You can add this automation to see details on context variable. -#### gitStream fails when using template strings with special characters (e.g., colon ':') +## gitStream fails when using template strings with special characters (e.g., colon ':') If a template string (e.g., pull request title, description, or other context variables) contains special characters such as a colon (`:`), gitStream might fail with a YAML parsing error due to invalid syntax. @@ -140,6 +140,35 @@ comment: | {{ pr.title }} ``` +## GitHub timeout issues with large repositories + +If you're experiencing timeout issues during GitHub Actions execution, particularly with large repositories or monorepos, this is typically caused by the time required to clone the entire repository history. + +You can resolve this by using the **lite version** of the gitStream GitHub Action, which performs a shallow clone to reduce execution time: + +```yaml +jobs: + gitStream: + timeout-minutes: 15 + runs-on: ubuntu-latest + name: gitStream workflow automation + steps: + - name: Evaluate Rules + uses: linear-b/gitstream-github-action@v2-lite + id: rules-engine +``` + +**Important limitations of the lite version:** +- Automations that rely on Git history (such as `code-experts`) may not work properly due to the shallow clone +- Historical data analysis features will be limited +- Some context variables that depend on full Git history may return incomplete results + +
+ + [:octicons-download-24: Download gitstream.yml (lite version)](/downloads/gitstream-lite.yml){ .md-button } + +
+ ## How can I debug expressions and see their content? You can dump any context value to the PR comment. For example, to see the list of changed files, use: