Install ZIO SBT CI Plugin and configure CI for docs#13
Install ZIO SBT CI Plugin and configure CI for docs#13Godzilla675 wants to merge 3 commits intoupdate-docsfrom
Conversation
- 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.
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Summary of ChangesHello @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 Highlights
Changelog
Ignored Files
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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
| 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$//')" | ||
| } |
There was a problem hiding this comment.
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
| 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 | ||
| } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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-citoproject/plugins.sbtand enable it inbuild.sbt(plus add alintalias). - Regenerate
.github/workflows/ci.ymlusingciGenerateGithubWorkflowto include build/lint/test/docs/release jobs. - Add a top-level
sbtrunner 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: {} |
There was a problem hiding this comment.
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).
| push: {} | |
| push: | |
| branches: | |
| - main |
| name: Build | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| continue-on-error: true |
There was a problem hiding this comment.
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.
| continue-on-error: true |
| branches-ignore: | ||
| - gh-pages | ||
| permissions: | ||
| id-token: write |
There was a problem hiding this comment.
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).
| id-token: write |
| - name: Test | ||
| run: sbt +test |
There was a problem hiding this comment.
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.
| - 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 |
| - name: Check artifacts build process | ||
| run: sbt +publishLocal | ||
| - name: Check website build process | ||
| run: sbt docs/clean; sbt docs/buildWebsite |
There was a problem hiding this comment.
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.
| run: sbt docs/clean; sbt docs/buildWebsite | |
| run: sbt "docs/clean; docs/buildWebsite" |
sbt
Outdated
| #!/usr/bin/env bash | ||
|
|
||
| set +e | ||
| declare builtin_sbt_version="1.10.11" | ||
| declare -a residual_args |
There was a problem hiding this comment.
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.
- 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.
This change installs the
zio-sbt-ciplugin to manage the project's CI configuration.It modifies
project/plugins.sbtto add the plugin dependency andbuild.sbtto enable the plugin on the root project.A new
lintcommand alias is added tobuild.sbtto support the generated CI workflow.The
.github/workflows/ci.ymlfile is regenerated usingsbt ciGenerateGithubWorkflowto 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