Skip to content

feat(cli): Makefile and build scripts#3208

Merged
alkalescent merged 1 commit intoDSPX-2655-migrate-otdfctlfrom
DSPX-2657-otdfctl-build
Mar 27, 2026
Merged

feat(cli): Makefile and build scripts#3208
alkalescent merged 1 commit intoDSPX-2655-migrate-otdfctlfrom
DSPX-2657-otdfctl-build

Conversation

@alkalescent
Copy link
Copy Markdown
Contributor

Proposed Changes

  • This PR updates the respective Makefiles for the monorepo and otdfctl as well as restoring the build scripts from the original otdfctl repo.

Checklist

  • I have added or updated unit tests
  • I have added or updated integration tests (if appropriate)
  • I have added or updated documentation

Testing Instructions

@alkalescent alkalescent requested review from a team as code owners March 25, 2026 20:46
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 25, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c148d8ba-5fe8-4627-a62f-dfeda5c6d5ca

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch DSPX-2657-otdfctl-build

Comment @coderabbitai help to get the list of available commands and usage tips.

@alkalescent alkalescent changed the title makefile and build scripts feat(cli): Makefile and build scripts Mar 25, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 refines the build infrastructure by integrating the otdfctl tool more seamlessly into the monorepo's Makefile system. It centralizes otdfctl's build and release utility scripts, enhancing the consistency and robustness of the build process for this specific component. The changes ensure that otdfctl binaries are correctly built, cleaned, compressed, and their integrity verified as part of the overall project lifecycle.

Highlights

  • Monorepo Makefile Integration: The root Makefile has been updated to properly include the otdfctl module in its build, clean, and phony targets, ensuring it's part of the monorepo's standard build process.
  • otdfctl Build Script Relocation: The otdfctl Makefile now references build and checksum verification scripts from a dedicated scripts directory within otdfctl, moving them from the .github/scripts location.
  • New Build Utility Scripts: Two new shell scripts, zip-builds.sh and verify-checksums.sh, have been added to otdfctl/scripts. These scripts handle the compression of built binaries (zipping for Windows, tar.gz for others) and the generation/verification of SHA256 checksums for release artifacts.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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.


Makefiles hum and sing, Scripts now neatly placed, they bring, Builds are clean and fast.

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.

@github-actions
Copy link
Copy Markdown
Contributor

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 153.345272ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 76.849079ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 403.021397ms
Throughput 248.13 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 39.119692863s
Average Latency 389.779139ms
Throughput 127.81 requests/second

Copy link
Copy Markdown
Contributor

@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 a new otdfctl command-line tool, integrating it into the main build system via Makefile updates for building, cleaning, and managing dependencies. It also adds new shell scripts, zip-builds.sh and verify-checksums.sh, within the otdfctl/scripts directory to automate binary packaging (zipping for Windows, tar-gzipping for others) and checksum verification for releases. The otdfctl/Makefile was updated to reference these new local scripts. The review feedback suggests improvements for both new scripts: zip-builds.sh should handle no-match globs, standardize archive structure by placing binaries at the root of the archive, and generate checksums in a standard format. verify-checksums.sh should be updated to parse the standard checksum filename format and exit with a non-zero status code if any checksum verification fails to ensure proper CI/CD integration.

Comment on lines +17 to +33
# Iterate over each line in the checksum file
while read -r line; do
# Extract the expected checksum and filename from each line
read -ra ADDR <<< "$line" # Read the line into an array
expectedChecksum="${ADDR[0]}"
fileName="${ADDR[2]}"

# Calculate the actual checksum of the file
actualChecksum=$(shasum -a 256 "$outputDir/$fileName" | awk '{print $1}')

# Compare the expected checksum with the actual checksum
if [ "$expectedChecksum" == "$actualChecksum" ]; then
echo "SUCCESS: Checksum for $fileName is valid."
else
echo "ERROR: Checksum for $fileName does not match."
fi
done < "$checksumFile"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

This script can be improved for robustness and to align with the suggested changes in zip-builds.sh:

  1. Handle standard checksum format: The verification logic should be updated to parse the standard checksum filename format. Using read with two variables is cleaner than creating an array.
  2. Report failure correctly: The script should exit with a non-zero status code if any checksum verification fails. This is crucial for CI/CD pipelines to detect build failures.
Suggested change
# Iterate over each line in the checksum file
while read -r line; do
# Extract the expected checksum and filename from each line
read -ra ADDR <<< "$line" # Read the line into an array
expectedChecksum="${ADDR[0]}"
fileName="${ADDR[2]}"
# Calculate the actual checksum of the file
actualChecksum=$(shasum -a 256 "$outputDir/$fileName" | awk '{print $1}')
# Compare the expected checksum with the actual checksum
if [ "$expectedChecksum" == "$actualChecksum" ]; then
echo "SUCCESS: Checksum for $fileName is valid."
else
echo "ERROR: Checksum for $fileName does not match."
fi
done < "$checksumFile"
# Iterate over each line in the checksum file
had_error=0
while read -r expectedChecksum fileName; do
# Skip empty lines
[ -z "$expectedChecksum" ] && continue
# Calculate the actual checksum of the file
actualChecksum=$(shasum -a 256 "$outputDir/$fileName" | awk '{print $1}')
# Compare the expected checksum with the actual checksum
if [ "$expectedChecksum" == "$actualChecksum" ]; then
echo "SUCCESS: Checksum for $fileName is valid."
else
echo "ERROR: Checksum for $fileName does not match."
had_error=1
fi
done < "$checksumFile"
exit $had_error

Comment on lines +22 to +38
for binary_file in "$binary_dir"/*; do
compressed=""
if [[ $binary_file == *.exe ]]; then
# If the file is a Windows binary, zip it
filename=$(basename "$binary_file")
compressed="${filename%.exe}.zip"
zip -j "$output_dir/$compressed" "$binary_file"
else
# For other binaries, tar and gzip them
filename=$(basename "$binary_file")
compressed="${filename}.tar.gz"
tar -czf "$output_dir/$compressed" "$binary_file"
fi

# Append checksums to the file
echo "$(cat "$output_dir/$compressed" | shasum -a 256) $compressed" >> $checksums_file
done
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This script can be improved for robustness and to follow standard practices:

  1. Handle no-match globs: The loop for binary_file in "$binary_dir"/* will execute with a literal * if no files are found. Add a check to skip non-existent files.
  2. Standardize archive structure: The tar command currently includes the target/ directory in the archive. Use the -C option to place the binary at the root of the archive, matching the behavior of the zip command for Windows binaries.
  3. Standardize checksum format: The current method of generating checksums is unconventional. It's better to generate a standard checksum file that can be verified with tools like shasum -c. This also simplifies the verification script.

Here is a suggested replacement for the loop that addresses these points. Note that this change will require a corresponding update to verify-checksums.sh.

Suggested change
for binary_file in "$binary_dir"/*; do
compressed=""
if [[ $binary_file == *.exe ]]; then
# If the file is a Windows binary, zip it
filename=$(basename "$binary_file")
compressed="${filename%.exe}.zip"
zip -j "$output_dir/$compressed" "$binary_file"
else
# For other binaries, tar and gzip them
filename=$(basename "$binary_file")
compressed="${filename}.tar.gz"
tar -czf "$output_dir/$compressed" "$binary_file"
fi
# Append checksums to the file
echo "$(cat "$output_dir/$compressed" | shasum -a 256) $compressed" >> $checksums_file
done
for binary_file in "$binary_dir"/*; do
[ -f "$binary_file" ] || continue # Handle case where no files match
filename=$(basename "$binary_file")
compressed=""
if [[ $binary_file == *.exe ]]; then
# If the file is a Windows binary, zip it
compressed="${filename%.exe}.zip"
zip -j "$output_dir/$compressed" "$binary_file"
else
# For other binaries, tar and gzip them without parent path
compressed="${filename}.tar.gz"
tar -czf "$output_dir/$compressed" -C "$(dirname "$binary_file")" "$filename"
fi
# Append checksums to the file in standard format
(cd "$output_dir" && shasum -a 256 "$compressed") >> "$checksums_file"
done

@github-actions
Copy link
Copy Markdown
Contributor

@alkalescent alkalescent force-pushed the DSPX-2655-migrate-otdfctl branch from 01cff81 to d66bd5b Compare March 26, 2026 22:46
@alkalescent alkalescent requested review from a team as code owners March 26, 2026 22:46
@alkalescent alkalescent force-pushed the DSPX-2655-migrate-otdfctl branch 2 times, most recently from fc2fac5 to 24366f4 Compare March 27, 2026 00:58
@alkalescent alkalescent force-pushed the DSPX-2657-otdfctl-build branch from 146adcf to a55588b Compare March 27, 2026 13:37
@github-actions
Copy link
Copy Markdown
Contributor

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 187.753912ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 96.093735ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 393.42357ms
Throughput 254.18 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 41.000644858s
Average Latency 408.619923ms
Throughput 121.95 requests/second

@github-actions
Copy link
Copy Markdown
Contributor

@alkalescent alkalescent merged commit 843a07a into DSPX-2655-migrate-otdfctl Mar 27, 2026
33 checks passed
@alkalescent alkalescent deleted the DSPX-2657-otdfctl-build branch March 27, 2026 19:29
alkalescent added a commit that referenced this pull request Apr 6, 2026
### Proposed Changes

* This PR updates the respective Makefiles for the monorepo and otdfctl
as well as restoring the build scripts from the original otdfctl repo.

### Checklist

- [ ] I have added or updated unit tests
- [ ] I have added or updated integration tests (if appropriate)
- [ ] I have added or updated documentation

### Testing Instructions
alkalescent added a commit that referenced this pull request Apr 10, 2026
* This PR updates the respective Makefiles for the monorepo and otdfctl
as well as restoring the build scripts from the original otdfctl repo.

- [ ] I have added or updated unit tests
- [ ] I have added or updated integration tests (if appropriate)
- [ ] I have added or updated documentation
alkalescent added a commit that referenced this pull request Apr 10, 2026
### Proposed Changes

* Add otdfctl component to platform release-please configuration for
independent versioned releases
* Tags follow the monorepo per-component pattern: `otdfctl/v0.30.0`
* Register `otdfctl/pkg/config/config.go` as extra-file so
release-please bumps the `Version` constant (already has `//
x-release-please-version` marker)
* Create release workflow that triggers on `otdfctl/v*` tags, builds 8
cross-platform binaries (darwin amd64/arm64, linux amd64/arm/arm64,
windows amd64/arm/arm64), and uploads artifacts to the GitHub release

#### Files added/modified

| File | Change |
|------|--------|
| `release-please-config.main.json` | Add `otdfctl` package entry with
`extra-files` |
| `release-please-manifest.json` | Add `"otdfctl": "0.30.0"` version
tracking |
| `release-please-config.otdfctl.json` | **New** — component config for
`release/otdfctl/vX.Y` branches |
| `release-otdfctl.yaml` | **New** — build and upload workflow on
release publish |

#### PR Stack (DSPX-2654)

1. #3205 — Subtree merge + module path rewrite (DSPX-2655, DSPX-2656)
2. #3208 — Makefile and build scripts (DSPX-2657)
3. #3221 — CI workflows (DSPX-2658)
4. #3236 — e2e tests and lint fixes (DSPX-2659)
5. **This PR** — Release pipeline (DSPX-2660)

### Checklist

- [ ] I have added or updated unit tests
- [x] I have added or updated integration tests (if appropriate)
- [x] I have added or updated documentation

### Testing Instructions

- Verify JSON configs are valid: `cat
.github/release-please/release-please-config.main.json | jq
.packages.otdfctl`
- Verify manifest version: `cat
.github/release-please/release-please-manifest.json | jq .otdfctl`
- Verify `reusable_release-please.yaml` config lookup: branch
`release/otdfctl/v0.30` → sanitized name `otdfctl` → resolves to
`release-please-config.otdfctl.json`
- Full release flow testable after merge by creating a manual release
with tag `otdfctl/v0.30.0`

---------

Signed-off-by: Krish Suchak <suchak.krish@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants