Skip to content

Install ZIO SBT CI Plugin and configure CI for docs#13

Open
Godzilla675 wants to merge 3 commits intoupdate-docsfrom
zio-sbt-ci-install-12715039345082391671
Open

Install ZIO SBT CI Plugin and configure CI for docs#13
Godzilla675 wants to merge 3 commits intoupdate-docsfrom
zio-sbt-ci-install-12715039345082391671

Conversation

@Godzilla675
Copy link
Copy Markdown
Owner

This change installs the zio-sbt-ci plugin to manage the project's CI configuration.
It modifies project/plugins.sbt to add the plugin dependency and build.sbt to enable the plugin on the root project.
A new lint command alias is added to build.sbt to support the generated CI workflow.
The .github/workflows/ci.yml file is regenerated using sbt ciGenerateGithubWorkflow to include standardized checks for build, test, lint, and documentation publishing.
This ensures that documentation contributions are properly checked and published as requested.


PR created automatically by Jules for task 12715039345082391671 started by @Godzilla675

- Added `zio-sbt-ci` plugin to `project/plugins.sbt`.
- Enabled `ZioSbtCiPlugin` in `build.sbt` for the root project.
- Added `lint` command alias to `build.sbt`.
- Generated `.github/workflows/ci.yml` using `sbt ciGenerateGithubWorkflow` to standardize CI configuration, including documentation checks and publishing.
Copilot AI review requested due to automatic review settings February 20, 2026 02:29
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @Godzilla675, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request streamlines the project's Continuous Integration setup by integrating the zio-sbt-ci plugin. This change aims to standardize the CI configuration, ensuring consistent checks for code quality, testing, and documentation publishing, thereby improving the reliability and maintainability of the development pipeline.

Highlights

  • ZIO SBT CI Plugin Integration: The zio-sbt-ci plugin has been installed to centralize and standardize CI configuration across the project.
  • CI Workflow Enhancement: A new lint command alias was added to build.sbt, and the CI workflow is intended to be regenerated to include comprehensive checks for build, test, lint, and documentation publishing.
  • Project Configuration Updates: project/plugins.sbt was updated to include the zio-sbt-ci plugin dependency, and build.sbt was modified to enable this plugin on both the root and examples projects.
Changelog
  • build.sbt
    • Added a lint command alias that executes the check command.
    • Enabled ZioSbtCiPlugin for the root project.
    • Enabled ZioSbtCiPlugin for the examples project.
  • project/plugins.sbt
    • Added zio-sbt-ci plugin dependency with version 0.4.10.
  • sbt
    • Added a new sbt shell script, which serves as a robust launcher for SBT, handling argument parsing, Java environment detection, memory allocation, and native client execution.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/ci.yml
Activity
  • PR created automatically by Jules for task 12715039345082391671 started by @Godzilla675.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the zio-sbt-ci plugin to manage the project's CI configuration. The changes in build.sbt and project/plugins.sbt are appropriate for this purpose. My review of the newly added sbt runner script has identified a bug in how it parses property files and a potential issue with parsing options that contain spaces. I have provided detailed comments and a code suggestion to address these findings.

sbt Outdated
Comment on lines +743 to +752
loadPropFile() {
# trim key and value so as to be more forgiving with spaces around the '=':
k=$(trimString $k)
v=$(trimString $v)
while IFS='=' read -r k v; do
if [[ "$k" == "sbt.version" ]]; then
build_props_sbt_version="$v"
fi
done <<< "$(cat "$1" | sed $'/^\#/d;s/\r$//')"
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The loadPropFile function doesn't correctly trim whitespace from the key and value read from the properties file. The trimString calls are outside the loop and operate on uninitialized variables. This means that if project/build.properties has spaces around the equals sign for sbt.version (e.g., sbt.version = 1.2.3), the version will not be detected. The comment indicating that it's forgiving with spaces is currently incorrect.

To fix this, the trimString calls should be moved inside the while loop.

loadPropFile() {
  while IFS='=' read -r k v; do
    # trim key and value so as to be more forgiving with spaces around the '=':
    k=$(trimString "$k")
    v=$(trimString "$v")
    if [[ "$k" == "sbt.version" ]]; then
      build_props_sbt_version="$v"
    fi
  done <<< "$(cat "$1" | sed $'/^\#/d;s/\r$//')"
}

sbt Outdated
Comment on lines +736 to +741
loadConfigFile() {
# Make sure the last line is read even if it doesn't have a terminating \n
cat "$1" | sed $'/^\#/d;s/\r$//' | while read -r line || [[ -n "$line" ]]; do
eval echo $line
done
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The loadConfigFile function uses eval echo $line, and its output is consumed via unquoted command substitution $(...) which is then word-split by the shell. This can lead to incorrect parsing of options from .sbtopts files if they contain spaces, even if quoted. For example, an option like -Dfoo="bar baz" will be incorrectly split into two arguments: -Dfoo=bar and baz. This can be very difficult to debug. For options with spaces, it's recommended to pass them on the command line directly instead of through opts files.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Installs the zio-sbt-ci SBT plugin and regenerates the repository’s GitHub Actions workflow so CI covers build, lint, tests, releases, and docs publishing in a standardized way.

Changes:

  • Add zio-sbt-ci to project/plugins.sbt and enable it in build.sbt (plus add a lint alias).
  • Regenerate .github/workflows/ci.yml using ciGenerateGithubWorkflow to include build/lint/test/docs/release jobs.
  • Add a top-level sbt runner script.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 6 comments.

File Description
sbt Adds a repo-local sbt runner shell script.
project/plugins.sbt Adds dev.zio:zio-sbt-ci plugin dependency.
build.sbt Adds lint alias and enables ZioSbtCiPlugin (root + examples).
.github/workflows/ci.yml Replaces the hand-written workflow with the plugin-generated CI workflow (build/lint/test/release/docs automation).

types:
- published
- published
push: {}
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

push: {} makes this workflow run on pushes to all branches. Combined with release being gated only by github.event_name != 'pull_request', this will attempt to run sbt ci-release on every branch push in the main repo (not just the default branch), which is risky. Restrict on.push.branches to the default branch (and/or add a github.ref == default_branch condition on the release job).

Suggested change
push: {}
push:
branches:
- main

Copilot uses AI. Check for mistakes.
name: Build
runs-on: ubuntu-latest
timeout-minutes: 10
continue-on-error: true
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

continue-on-error: true on the build job can allow the overall CI (ci job) to succeed even when compilation/publishLocal/docs build fails, because ci only checks job completion. This weakens the safety of the pipeline, especially since release depends on ci. Set continue-on-error to false (or remove it) for build.

Suggested change
continue-on-error: true

Copilot uses AI. Check for mistakes.
branches-ignore:
- gh-pages
permissions:
id-token: write
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Workflow-level permissions grants id-token: write for all jobs (including PR runs). This is broader than needed and increases the blast radius if a job is compromised. Prefer setting minimal default permissions at the workflow level (e.g., contents: read) and granting id-token: write only on the specific job(s) that actually need OIDC (typically release/docs publish).

Suggested change
id-token: write

Copilot uses AI. Check for mistakes.
Comment on lines +103 to +104
- name: Test
run: sbt +test
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new test job only runs sbt +test and no longer runs coverage tasks (e.g., coverage/coverageReport). Since the build defines coverageMinimum* thresholds, removing coverage from CI means those thresholds are no longer enforced. Consider adding a dedicated coverage run (at least on one JDK) so coverage regressions are still caught.

Suggested change
- name: Test
run: sbt +test
- name: Test (no coverage)
if: ${{ matrix.java != '17' }}
run: sbt +test
- name: Test with coverage
if: ${{ matrix.java == '17' }}
run: sbt coverage +test coverageReport

Copilot uses AI. Check for mistakes.
- name: Check artifacts build process
run: sbt +publishLocal
- name: Check website build process
run: sbt docs/clean; sbt docs/buildWebsite
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step runs two separate sbt invocations (sbt docs/clean; sbt docs/buildWebsite), which is slower and redoes startup/resolution work. Prefer a single sbt invocation that runs both tasks in one session to reduce CI time and flakiness.

Suggested change
run: sbt docs/clean; sbt docs/buildWebsite
run: sbt "docs/clean; docs/buildWebsite"

Copilot uses AI. Check for mistakes.
sbt Outdated
Comment on lines +1 to +5
#!/usr/bin/env bash

set +e
declare builtin_sbt_version="1.10.11"
declare -a residual_args
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR introduces a new top-level sbt runner script, but the PR description doesn’t mention it. Since this is a large third-party style script and affects developer tooling expectations, please clarify why it’s being added (e.g., required by zio-sbt-ci generation) and whether it should be checked in or generated.

Copilot uses AI. Check for mistakes.
- Configure `ciJvmOptions` to include `-Djava.locale.providers=CLDR,JRE` for locale-sensitive tests.
- Update `ciPostReleaseJobs` to inject `NODE_AUTH_TOKEN` environment variable into the `release-docs` job.
- Regenerate `.github/workflows/ci.yml` with the correct settings.
- Add `zio-sbt-ci` plugin to `project/plugins.sbt`.
- Enable `ZioSbtCiPlugin` in `build.sbt`.
- Configure `ciJvmOptions` to include `-Djava.locale.providers=CLDR,JRE` for locale-sensitive tests on Java 17+.
- Inject `NODE_AUTH_TOKEN` into the `release-docs` job via `ciPostReleaseJobs` to enable NPM publishing.
- Generate `.github/workflows/ci.yml` using `sbt ciGenerateGithubWorkflow`.
- Add `lint` alias to `build.sbt` as required by the CI workflow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants