Files
zeekay 1b367e2b62 chore: rebase the tree onto upstream master
The tree was a debranded snapshot of upstream taken around 2026-02-20, and
upstream has moved about five months since. This replaces it with upstream
master, mechanically re-derived: bin/debrand does the rename, and the
pipeline and squashed migrations are restored from the shipped tree.

Not a merge. The previous import replaced the tree wholesale in a single
commit, so there is no shared content history to merge against. Reproducing
the rename on the new tree is what actually converges.

What survives: .hanzo/workflows, the Dockerfiles and bin/docker* entrypoints,
compose files, LLM.md, and insights/migrations. The squashed initial
migration is load-bearing — the live database records it by name, so
upstream's ~918 individual migrations cannot come back.

Nine products are dropped as unreferenced. Twenty-one more that we do not run
are kept anyway because the core app still imports them; unpicking those is a
refactor and does not belong in a rebase.

This base does not build yet, and the reasons are not in the rename:
upstream now wants Python 3.13.13 against our 3.12.12 and Django 5.2 against
our 4.2, and the dependency manifests still name upstream packages that we
republish under our own names. Those are decisions, not renames.
2026-08-01 15:44:40 -07:00

158 lines
5.5 KiB
TypeScript

import { OnboardingComponentsContext, createInstallation } from 'scenes/onboarding/shared/OnboardingDocsContentWrapper'
import { getRubyOnRailsSteps as getRubyOnRailsStepsPA } from '../product-analytics/ruby-on-rails'
import { StepDefinition } from '../steps'
export const getRubyOnRailsSteps = (ctx: OnboardingComponentsContext): StepDefinition[] => {
const { CodeBlock, Markdown, dedent } = ctx
const installSteps = getRubyOnRailsStepsPA(ctx)
const configureErrorTrackingStep: StepDefinition = {
title: 'Configure error tracking',
badge: 'required',
content: (
<>
<Markdown>
{dedent`
Update \`config/initializers/insights.rb\` to enable automatic exception capture:
`}
</Markdown>
<CodeBlock
blocks={[
{
language: 'ruby',
file: 'config/initializers/insights.rb',
code: dedent`
Insights::Rails.configure do |config|
config.auto_capture_exceptions = true
config.report_rescued_exceptions = true
config.auto_instrument_active_job = true
config.capture_user_context = true
config.current_user_method = :current_user
end
`,
},
]}
/>
</>
),
}
const autoCaptureStep: StepDefinition = {
title: 'Automatic exception capture',
badge: 'recommended',
content: (
<>
<Markdown>
{dedent`
With \`auto_capture_exceptions\` enabled, exceptions are automatically captured from your controllers:
`}
</Markdown>
<CodeBlock
blocks={[
{
language: 'ruby',
file: 'app/controllers/posts_controller.rb',
code: dedent`
class PostsController < ApplicationController
def show
@post = Post.find(params[:id])
# Any exception here is automatically captured
end
end
`,
},
]}
/>
</>
),
}
const backgroundJobsStep: StepDefinition = {
title: 'Background jobs',
badge: 'optional',
content: (
<>
<Markdown>
{dedent`
When \`auto_instrument_active_job\` is enabled, ActiveJob exceptions are automatically captured:
`}
</Markdown>
<CodeBlock
blocks={[
{
language: 'ruby',
file: 'app/jobs/email_job.rb',
code: dedent`
class EmailJob < ApplicationJob
def perform(user_id)
user = User.find(user_id)
UserMailer.welcome(user).deliver_now
# Exceptions are automatically captured with job context
end
end
`,
},
]}
/>
</>
),
}
const manualCaptureStep: StepDefinition = {
title: 'Manually capture exceptions',
badge: 'optional',
content: (
<>
<Markdown>
{dedent`
You can also manually capture exceptions that you handle in your application:
`}
</Markdown>
<CodeBlock
blocks={[
{
language: 'ruby',
file: 'Ruby',
code: dedent`
Insights.capture_exception(
exception,
current_user.id,
{ custom_property: 'value' }
)
`,
},
]}
/>
</>
),
}
const verifyStep: StepDefinition = {
title: 'Verify error tracking',
badge: 'recommended',
checkpoint: true,
content: (
<Markdown>
{dedent`
Confirm exception events are being captured and sent to Insights. You should see events appear in the activity feed.
[Check for exceptions in Insights](https://app.hanzo.ai/activity/explore)
`}
</Markdown>
),
}
return [
...installSteps,
configureErrorTrackingStep,
autoCaptureStep,
backgroundJobsStep,
manualCaptureStep,
verifyStep,
]
}
export const RubyOnRailsInstallation = createInstallation(getRubyOnRailsSteps)