Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/assets/screenshots/rego-version-selector.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion docs/concepts/policy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ For more detailed information about the GraphQL API and its integration, please

[Rego](https://www.openpolicyagent.org/docs/latest/policy-language/){: rel="nofollow"}, the language we're using to execute policies, is a very elegant, Turing incomplete data query language. If you know SQL and [`jq`](https://stedolan.github.io/jq/){: rel="nofollow"}, you should find Rego familiar and only need a few hours to understand its quirks. For each policy, we also provide examples you can tweak to achieve your goals.

#### Rego version support

Spacelift supports both Rego v0 and v1. You can switch between versions at any time when editing a policy using the version selector in the policy editor.

![Select rego version](<../../assets/screenshots/rego-version-selector.png>)

**We recommend using Rego v1 for all new policies.** Rego v1 introduces improved syntax and stricter semantics that make policies more robust and easier to maintain. For information on migrating existing policies from v0 to v1, see the [OPA migration guide](https://www.openpolicyagent.org/docs/v0-upgrade#changes-to-rego-in-opa-v10){: rel="nofollow"}.

### Rego constraints

To keep policies functionally pure and relatively snappy, we disabled some Rego built-ins that can query external or runtime data. These are:
Expand All @@ -83,7 +91,7 @@ Policies must be self-contained and cannot refer to external resources (e.g. fil
!!! info

Disabling `time.now_ns` may seem surprising, but depending on the current timestamp it can make your policies impure and thus tricky to test. We encourage you to [test your policies thoroughly](#testing-policies)!

The current timestamp in Rego-compatible form (Unix nanoseconds) is available as `spacelift.request.timestamp_ns` in plan policy payloads, so please use it instead.

## Policy returns and rules
Expand Down
5 changes: 3 additions & 2 deletions docs/getting-started/integrate-source-code/GitHub.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ Once the integration name and the type are chosen, a **webhook endpoint** and a

Now that your GitHub App has been created, return to the integration configuration screen in Spacelift.

<!-- markdown-link-check-disable-next-line -->
1. **API host URL**: Enter the URL to your GitHub server, which should be [https://api.github.com](https://api.github.com){: rel="nofollow"}.
2. **User facing host URL**: Enter the URL that will be shown to the user and displayed in the Spacelift UI. This will be the same as the API host URL unless you are using [VCS Agents](../../concepts/vcs-agent-pools.md), in which case it should be `private://<vcs-agent-pool-name>`.
3. **App ID**: Enter the App ID you copied before generating the private key.
Expand All @@ -142,7 +143,7 @@ Once your GitHub app has been created and configured in Spacelift, you can insta
![](<../../assets/screenshots/github_install_app.png>)
2. On GitHub, click **Install**.
3. Choose whether you want to allow Spacelift access to all repositories or only specific ones in the account:

![](<../../assets/screenshots/image (60).png>)
4. Click **Install** to link your GitHub account to Spacelift.

Expand All @@ -153,7 +154,7 @@ Once your GitHub app has been created and configured in Spacelift, you can insta
2. In the _Install App_ section, click **Install** next to the account you want Spacelift to access:
![](<../../assets/screenshots/image (59).png>)
3. Choose whether you want to allow Spacelift access to all repositories or only specific ones in the account:

![](<../../assets/screenshots/image (60).png>)
4. Click **Install** to link your GitHub account to Spacelift.

Expand Down
5 changes: 3 additions & 2 deletions docs/integrations/source-control/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ Once the integration name and the type are chosen, a **webhook endpoint** and a

Now that your GitHub App has been created, return to the integration configuration screen in Spacelift.

<!-- markdown-link-check-disable-next-line -->
1. **API host URL**: Enter the URL to your GitHub server, which should be [https://api.github.com](https://api.github.com){: rel="nofollow"}.
2. **User facing host URL**: Enter the URL that will be shown to the user and displayed in the Spacelift UI. This will be the same as the API host URL unless you are using [VCS Agents](../../concepts/vcs-agent-pools.md), in which case it should be `private://<vcs-agent-pool-name>`.
3. **App ID**: Enter the App ID you copied before generating the private key.
Expand All @@ -144,7 +145,7 @@ Once your GitHub app has been created and configured in Spacelift, you can insta
![](<../../assets/screenshots/github_install_app.png>)
2. On GitHub, click **Install**.
3. Choose whether you want to allow Spacelift access to all repositories or only specific ones in the account:

![](<../../assets/screenshots/image (60).png>)
4. Click **Install** to link your GitHub account to Spacelift.

Expand All @@ -155,7 +156,7 @@ Once your GitHub app has been created and configured in Spacelift, you can insta
2. In the _Install App_ section, click **Install** next to the account you want Spacelift to access:
![](<../../assets/screenshots/image (59).png>)
3. Choose whether you want to allow Spacelift access to all repositories or only specific ones in the account:

![](<../../assets/screenshots/image (60).png>)
4. Click **Install** to link your GitHub account to Spacelift.

Expand Down
6 changes: 6 additions & 0 deletions docs/product/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ description: Find out about the latest changes to Spacelift.

# Changelog

## 2025-11-07

### Features

- **Rego Version Selector**: Added support for switching between Rego v0 and v1 when editing policies. A version selector is now available in the policy editor, allowing you to easily switch between versions. We recommend using Rego v1 for all new policies. See the [policy documentation](../concepts/policy/README.md#rego-version-support) for more information.

## 2025-10-27

### Features
Expand Down