Skip to content

Conversation

@ngudbhav
Copy link

@ngudbhav ngudbhav commented Apr 29, 2024

CodeAnt-AI Description

Add Podman support, S3-backed nodestore/profiles migration, PGBouncer migration, local JS SDK hosting, and more robust installer checks

What Changed

  • Installer can run with either Docker or Podman; commands, compose detection and version checks adapt to the selected engine and surface a clear error if Podman/docker is missing
  • Automatically bootstraps SeaweedFS S3 buckets for nodestore and profiles, migrates existing profile files from the sentry-vroom volume to the "profiles" bucket, and applies bucket lifecycle policies
  • Offers to (or automates when flagged) update sentry config files to point nodestore and profiles to S3 and to switch Postgres host to PGBouncer when a standard Postgres config is detected
  • Optionally downloads and serves JS SDK bundles into the nginx volume for air-gapped environments, with an option to keep or prune previous assets
  • Stronger preflight checks and safety: validates container engine + compose versions (docker vs podman), enforces minimum Bash version, checks CPU/RAM thresholds based on profile, and improves service start/wait logic and ClickHouse/Postgres upgrade flows
  • Several new unit and integration test scripts exercising S3 bootstrapping, JS SDK asset setup, PGBouncer migration, multi-bucket handling, and other installer behaviors
  • Multiple UX and reliability fixes: safer backup/restore/reset handling, deterministic logging, improved prompts with an APPLY_AUTOMATIC_CONFIG_UPDATES flag to avoid interactive prompts

Impact

✅ Podman installs supported (same flow as Docker)
✅ Fewer failed installs due to missing/incorrect container engine or service startup timing
✅ Local JS SDK bundles available for air-gapped or restricted environments

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

BYK and others added 30 commits December 6, 2024 10:55
Follow up to #3427 (comment) where we created and mounted a custom Redis config only to not use it 🤦
Our default fallback, `_assets`, assumes we use a CDN which is not the case on self-hosted. This patch adds a stop-gap fix for front-end URLs asking for this path.

Should fix #3479 and #3470.
….1 (#3492)

Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 1.11.0 to 1.11.1.
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Commits](actions/create-github-app-token@5d869da...c1a2851)

---
updated-dependencies:
- dependency-name: actions/create-github-app-token
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
`geoipupdate` is not used by any other service nor it is needed for any
service to run. Moreover, it is a one-shot command, causing
`docker compose up --wait` to fail when it exits with a non-zero status.
This happens when one has not yet set up their credentials and they may
choose to never do this.

This PR removes `geoipupdate` from the `docker-compose.yml` file and
moves the command directly into the geoip related script. One may run
this whenever they want to update their GeoIP database.

This PR needs an accompanying docs change.
I think we split these actions in the past due to some lack of options for them to work together properly. Right now looks like `bootstrap` would automatically migrate and propagates the `force` flag.
Update `_lib.sh` to remove the extra space in the log file name.
This fixes the log files name not being included in `.gitinore`
This patch caches all DB volumes based on the sentry and snuba images to avoid doing the same migrations over and over for every test run.

This shaved off a whole minute from "Install self-hosted" jobs (so ~20% speed increase).

Left side: cached re-run -- Right side: no-cache initial run
![image](https://github.com/user-attachments/assets/55b923ea-d4c8-44bf-ba3e-0d5708781fd8)
Docker Compose is much more robust nowadays compared to the past where we had to maintain tests for both v1 and v2 and then a specific version of v2. Hence, we are removing tests for the older versions of Docker Compose with this patch. We also remove the separate tests for customizations and w/o customizations as the one with customizations should cover the one without them anyway. This reduces the CI workload to 25% of what it was
This is an initial transitionary patch before landing #3516. Once we land this, we will update users of the old action to use this one and remove that repo. Then land #3516 safely.

Great thing is, with this patch and the subsequent update to getsentry/action-self-hosted-e2e-tests to use this one, all the repos would be using the Docker Volume caching we introduced in #3488.
From
```
================== 11 passed, 4 warnings in 762.35s (0:12:42) ==================
```

to
```
================== 11 passed, 4 warnings in 343.58s (0:05:43) ==================
```
Instead of using direct image hashes, only use hashes from migrations folders for each respective image for cache key generation. Should increase cache hit rate significantly as we don't have migrations much.

Also swaps the key order from `sentry-snuba` to `snuba-senry` assuming Snuba has less frequent migration additions.
@codeant-ai
Copy link

codeant-ai bot commented Jan 9, 2026

CodeAnt AI is running Incremental review


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

* Include SDK version 10 when using local JS SDK assets

* Updated unit test to check for 9.* and 10.* versions of the SDK bundles
@codeant-ai
Copy link

codeant-ai bot commented Jan 13, 2026

CodeAnt AI is running Incremental review


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai
Copy link

codeant-ai bot commented Jan 15, 2026

CodeAnt AI is running Incremental review


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai bot added size:XXL This PR changes 1000+ lines, ignoring generated files and removed size:XXL This PR changes 1000+ lines, ignoring generated files labels Jan 15, 2026
Comment on lines +3 to +6
Sentry.captureFeedback({
message: "I love your startup!",
name: "John Doe",
email: "john@example.com",
Copy link

Choose a reason for hiding this comment

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

Suggestion: Wrong Sentry API: captureFeedback is not a function in the Node SDK and will throw a TypeError at runtime; use the correct API captureUserFeedback and map the message field to comments. [type error]

Severity Level: Critical 🚨
- ❌ Integration test _integration-test/nodejs/user-feedback.js fails.
- ⚠️ CI job running Node integration tests will error.
- ⚠️ Developer local runs crash with TypeError.
Suggested change
Sentry.captureFeedback({
message: "I love your startup!",
name: "John Doe",
email: "john@example.com",
Sentry.captureUserFeedback({
name: "John Doe",
email: "john@example.com",
comments: "I love your startup!",
Steps of Reproduction ✅
1. Run the integration script directly: `node _integration-test/nodejs/user-feedback.js`.
The file imports Sentry at `_integration-test/nodejs/user-feedback.js:1`.

2. Execution reaches the call at `_integration-test/nodejs/user-feedback.js:3` where
`Sentry.captureFeedback({...})` is invoked.

3. At runtime Node attempts to look up `captureFeedback` on the imported Sentry object and
fails because the Node SDK does not export `captureFeedback`. Node throws `TypeError:
Sentry.captureFeedback is not a function`, with a stack trace pointing to
`_integration-test/nodejs/user-feedback.js:3`.

4. The script terminates with an uncaught exception before reaching the flush call at
`_integration-test/nodejs/user-feedback.js:11`. This is a concrete, reproducible failure
when the integration test/script is executed as-is.
Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** _integration-test/nodejs/user-feedback.js
**Line:** 3:6
**Comment:**
	*Type Error: Wrong Sentry API: `captureFeedback` is not a function in the Node SDK and will throw a TypeError at runtime; use the correct API `captureUserFeedback` and map the `message` field to `comments`.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.


# `sdk_files` should contains 7 lines, '4.*', '5.*', '6.*', `7.*`, `8.*`, `9.*`, and `10.*`
echo $sdk_files
total_directories=$(echo "$sdk_files" | grep -c '[4-9|10]\.[0-9]*\.[0-9]*$')
Copy link

Choose a reason for hiding this comment

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

Suggestion: The grep pattern uses a character class with '|' and '10' inside ([4-9|10]...), which does not implement alternation and will incorrectly match digits '1' and '0' separately (and the '|' character); this causes total_directories to be miscounted. Use extended regex alternation and proper anchors to reliably match version-like directory names. [logic error]

Severity Level: Critical 🚨
- ❌ CI unit test fails blocking merges.
- ⚠️ SDK asset verification reports incorrect counts.
- ⚠️ Release gating depends on these tests.
Suggested change
total_directories=$(echo "$sdk_files" | grep -c '[4-9|10]\.[0-9]*\.[0-9]*$')
total_directories=$(echo "$sdk_files" | grep -E -c '^(4|5|6|7|8|9|10)\.[0-9]+\.[0-9]+$')
Steps of Reproduction ✅
1. Run the test script directly: execute `_unit-test/js-sdk-assets-test.sh` from
repository root (script shebang is at the top of the file). The script sources
`install/setup-js-sdk-assets.sh` and then assigns `sdk_files` at line 11
(`sdk_files=$($dcr --no-deps nginx ls -lah /var/www/js-sdk/)`) and proceeds.

2. After assets are populated, the script computes `total_directories` at line 18
(`total_directories=$(echo "$sdk_files" | grep -c '[4-9|10]\.[0-9]*\.[0-9]*$')`). This
uses a character class `[4-9|10]` instead of alternation, per the code at line 18.

3. Observe result: when directory entries include names like `10.0.0` or other filenames
with digits in different columns, the character-class will match unintended characters
(`1`, `0`, or `|`) and either overcount or miscount directories; the variable
`total_directories` will not reliably equal the expected `7`.

4. The mismatch propagates to the assertion at line 20 (`test "7" ==
"$total_directories"`), causing the test to fail in CI. The improved grep with alternation
(grep -E '^(4|5|6|7|8|9|10)\...') reproduces the intended matching and fixes counts.
Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** _unit-test/js-sdk-assets-test.sh
**Line:** 18:18
**Comment:**
	*Logic Error: The grep pattern uses a character class with '|' and '10' inside ([4-9|10]...), which does not implement alternation and will incorrectly match digits '1' and '0' separately (and the '|' character); this causes `total_directories` to be miscounted. Use extended regex alternation and proper anchors to reliably match version-like directory names.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.

done

# Verify that all buckets were created successfully
bucket_list=$($s3cmd --access_key=sentry --secret_key=sentry --no-ssl --region=us-east-1 --host=localhost:8333 --host-bucket='localhost:8333/%(bucket)' ls)
Copy link

Choose a reason for hiding this comment

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

Suggestion: Race condition / flaky test: the script lists buckets immediately after creating them without retrying; the creation may not be visible instantly, causing intermittent failures—add a short retry loop with a timeout when collecting bucket_list. [race condition]

Severity Level: Critical 🚨
- ❌ CI test suite experiences intermittent failures.
- ⚠️ SeaweedFS bucket-tests become flaky.
- ⚠️ Developers face noisy, unreliable CI runs.
Suggested change
bucket_list=$($s3cmd --access_key=sentry --secret_key=sentry --no-ssl --region=us-east-1 --host=localhost:8333 --host-bucket='localhost:8333/%(bucket)' ls)
S3_ACCESS_KEY="${S3_ACCESS_KEY:-sentry}"
S3_SECRET_KEY="${S3_SECRET_KEY:-sentry}"
max_retries=5
attempt=0
bucket_list=""
while [ $attempt -lt $max_retries ]; do
bucket_list=$($s3cmd --access_key="$S3_ACCESS_KEY" --secret_key="$S3_SECRET_KEY" --no-ssl --region=us-east-1 --host=localhost:8333 --host-bucket='localhost:8333/%(bucket)' ls 2>/dev/null) && break
attempt=$((attempt + 1))
sleep 1
done
Steps of Reproduction ✅
1. Run the script in CI: it creates buckets in the loop at lines 14-16, then immediately
lists buckets at line 19 into bucket_list.

2. If the SeaweedFS s3 endpoint or s3cmd exhibits eventual consistency or slight
propagation delay, the newly-created buckets may not appear instantly in the ls output.
The subsequent check (lines 20-25) will detect missing buckets and exit with error.

3. Reproduce by adding artificial delay to SeaweedFS or running tests under load: create
buckets (lines 14-16) then immediately run the ls command (line 19); observe intermittent
failures where grep at line 21 does not find entries and the script exits.

4. Because the script performs no retries, these timing-dependent failures manifest as
flaky CI unit-test failures. Adding a short retry loop with timeout (as proposed)
stabilizes the check and prevents transient test failures.
Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** _unit-test/multiple-seaweedfs-bucket-test.sh
**Line:** 19:19
**Comment:**
	*Race Condition: Race condition / flaky test: the script lists buckets immediately after creating them without retrying; the creation may not be visible instantly, causing intermittent failures—add a short retry loop with a timeout when collecting `bucket_list`.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.

@codeant-ai
Copy link

codeant-ai bot commented Jan 15, 2026

CodeAnt AI Incremental review completed.

@codeant-ai
Copy link

codeant-ai bot commented Jan 30, 2026

CodeAnt AI is running Incremental review


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai bot added size:XXL This PR changes 1000+ lines, ignoring generated files and removed size:XXL This PR changes 1000+ lines, ignoring generated files labels Jan 30, 2026
@codeant-ai
Copy link

codeant-ai bot commented Jan 30, 2026

CodeAnt AI Incremental review completed.

@codeant-ai
Copy link

codeant-ai bot commented Feb 1, 2026

CodeAnt AI is running Incremental review


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai bot added size:XXL This PR changes 1000+ lines, ignoring generated files and removed size:XXL This PR changes 1000+ lines, ignoring generated files labels Feb 1, 2026
@codeant-ai
Copy link

codeant-ai bot commented Feb 1, 2026

CodeAnt AI Incremental review completed.

@codeant-ai
Copy link

codeant-ai bot commented Feb 2, 2026

CodeAnt AI is running Incremental review


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai bot added size:XXL This PR changes 1000+ lines, ignoring generated files and removed size:XXL This PR changes 1000+ lines, ignoring generated files labels Feb 2, 2026
@codeant-ai
Copy link

codeant-ai bot commented Feb 2, 2026

CodeAnt AI Incremental review completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL This PR changes 1000+ lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.