Skip to content

Adding ability to build and test heimdall using makefile - #196

Open
babourine wants to merge 15 commits into
patterninc:mainfrom
babourine:stan_makefile
Open

babourine wants to merge 15 commits into
patterninc:mainfrom
babourine:stan_makefile

Conversation

@babourine

Copy link
Copy Markdown
Contributor

Adding ability to build and test heimdall using Makefile. This PR:

  • replaces custom build.sh (still keeping it for backward compat) and replaces it with industry standard make tool
  • moving logic out of main() function to heimdall package to increase the surface we can test
  • adding local-cli.yaml config file to be able to run and test heimdall w/o docker container locally pointing it to postgres db server in container.
  • switching config load to strict mode (that uncovered unknown store_result_sync config key [removed])
  • binary build version can be seen using heimdall version command now and includes built version, commit SHA and time stamp it was built.
  • it includes changes from PR Bumping versions for dependencies #174 so I suggest merging that one first.

Copilot AI balanced review requested due to automatic review settings December 1, 2026 19:35
@wiz-55ccc8b716

wiz-55ccc8b716 Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities 1 Medium
Data Finding Sensitive Data -
Secret Finding Secrets 1 Low
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings -
Software Management Finding Software Management Findings -
Total 1 Medium 1 Low

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try the Wiz Code extension for VS Code, JetBrains, or Visual Studio.

Copilot AI left a comment

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.

🟡 Changes recommended

Configuration-only commands trigger runtime initialization that can mutate the database and claim jobs, while build rules can leave stale binaries and incompatible plugins.

4 open issues
1 file not reviewed
  • web/pnpm-lock.yaml: Generated file
What changed in this PR

This PR introduces Make-based build and test workflows for Heimdall and moves CLI handling into the service package. It also includes dependency updates from #174 and refreshes web UI snapshots.

Changes:

  • Adds Make targets for binaries, plugins, web assets, tests, and coverage; updates Docker and CI integration.
  • Adds CLI subcommands, strict configuration loading, build metadata, and a local development configuration.
  • Updates Go and web dependencies, with corresponding snapshot changes.
File Description
web/​src/​components/​ListPage/​__snapshots__/​ListPage.test.tsx.snap Refreshes list-page markup, styling, and accessibility snapshots.
web/​src/​components/​DetailPage/​__snapshots__/​DetailPage.test.tsx.snap Refreshes detail-page markup and styling snapshots.
web/​pnpm-lock.yaml Updates Pattern UI and transitive dependencies.
README.md Documents Make targets and CLI commands.
node_modules/​.pnpm-workspace-state-v1.json Adds generated local pnpm workspace metadata.
node_modules/​.modules.yaml Adds generated local pnpm installation metadata.
Makefile Adds build, test, coverage, and maintenance targets.
internal/​pkg/​object/​command/​starrocks/​job_context.go Removes an extra blank line.
internal/​pkg/​heimdall/​keepalive.go Removes the relocated keepalive default.
internal/​pkg/​heimdall/​job.go Uses build metadata for job versions; corrects a comment.
internal/​pkg/​heimdall/​heimdall.go Adds defaults, CLI dispatch, strict loading, and build metadata.
internal/​pkg/​auth/​auth.go Reorganizes imports without behavior changes.
go.sum Updates Go dependency checksums.
go.mod Updates the Go requirement and dependencies.
entrypoint.sh Uses the new binary directory and server subcommand.
Dockerfile Uses Make for builds and updates the Go image.
configs/​local.yaml Adjusts plugin paths and removes an unsupported key.
configs/​local-cli.yaml Adds configuration for local execution against containerized PostgreSQL.
cmd/​heimdall/​heimdall.go Delegates CLI execution to the Heimdall package.
.github/​workflows/​build.yml Updates Go and switches CI to Make.

Review effort: Balanced

Comment thread Makefile Resolved
Comment thread internal/pkg/heimdall/heimdall.go Resolved
Comment thread Dockerfile Resolved
if err != nil {
return err
}
data, err := yaml.Marshal(h)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We can address this in the follow-up PRs. It's informative feature and not needed to run heimdall. I identified a couple of places that will need to adjust, to make those changes as part of this PR will make it pretty dense.

babourine and others added 5 commits December 1, 2026 14:30
…eave stale binaries and plugins'

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…tion so Init() call remains just a read call and does not change anything (support of validate and print commands)
@babourine

Copy link
Copy Markdown
Contributor Author

prasadlohakpure ^ one more pls after #174

Comment thread Makefile

# Version
MODULE := $(shell $(GO) list -m)
BUILD_PKG := github.com/babourine/x/pkg/build

@prasadlohakpure prasadlohakpure Dec 4, 2026 •

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.

LDFlag now builds without main.Build and the version symbol is github.com/babourine/x/pkg/build.Version. Can we resolve this parity between build.sh and make file?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I hope build.sh completely goes away. Pls see PR #197 . I'd keep build.sh only maybe for a week. In stan_main in my fork, I do not use the build.sh at all anymore as running make with the target I need is so much more convenient, plus it has more targets (functionality) than build.sh. I'd suggest pausing on merging this PR for a second, until you guys review #197 and comfortable with it; then just merge them together. Once you're comfortable w/make (I'd suggest playing w/it in checked out branch (#197), we can nuke build.sh -- it served its purpose extremely well!)

@prasadlohakpure

Copy link
Copy Markdown
Contributor

babourine thanks a lot for this change! Just one nitpick, rest looks good!

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.

3 participants