Skip to content

Conversation

@ngudbhav
Copy link

@ngudbhav ngudbhav commented Apr 29, 2024

CodeAnt-AI Description

Add Podman support, S3-backed node/profile migrations, and optional local JS SDK hosting

What Changed

  • Installer can use Podman or Docker interchangeably (new --container-engine-podman flag); compose and run commands adapt and preflight checks validate Podman versions and Bash; outputs now reference the chosen engine
  • Automatic migration paths for storage: nodestore and profiling data can be moved into SeaweedFS S3 buckets during install; the installer creates buckets, applies lifecycle policies, and can copy existing vroom profile files into the new profiles bucket
  • Config auto-update prompts (or flags to auto-apply) will update sentry.conf.py / config.yml to point to PGBouncer, nodestore S3, and profiles S3 when safe to do so
  • Option to host JS SDK bundles locally: installer can fetch current browser SDK variants into nginx volume and set permissions, with an option to keep previous assets
  • Upgrade and setup flows improved: ClickHouse and Postgres upgrade steps handled during install; database migrations/resets and admin commands wait for required services; backup/restore now uses consistent paths and permission handling
  • Several new unit and integration tests added to verify S3 bootstrapping, JS SDK asset setup, pgbouncer migration, and other flows; various scripts hardened to avoid permission and race issues

Impact

✅ Podman installs supported (same UX as Docker)
✅ Safer profiles and nodestore migration to S3-backed storage
✅ 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.

getsentry-bot and others added 30 commits November 26, 2024 17:27
The backup-method described in the [documentation](https://develop.sentry.dev/self-hosted/backup/#backup) `./scripts/backup.sh` creates a backup file at `sentry/backup.json` which should be ignored by git.

### Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
* Replace release bot with GH app

* remove unneeded app token
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.
@codeant-ai
Copy link

codeant-ai bot commented Dec 9, 2025

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

Prevents the very confusing 'Unsupported Docker Architecture' error when we actually had a permission error running docker.
@codeant-ai
Copy link

codeant-ai bot commented Dec 9, 2025

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 Dec 11, 2025

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 Dec 12, 2025

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 Dec 16, 2025

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 Dec 23, 2025

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 5, 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

Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 7.1.5 to 7.1.6.
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](astral-sh/setup-uv@ed21f2f...681c641)

---
updated-dependencies:
- dependency-name: astral-sh/setup-uv
  dependency-version: 7.1.6
  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>
@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.

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.