Skip to content

fix: Make docker and stuff run for CI. #3792

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 15, 2025
Merged

Conversation

perkinsjr
Copy link
Collaborator

@perkinsjr perkinsjr commented Aug 14, 2025

What does this PR do?

I dunno if this is the right thing, or if it works, or if we should have tsts.

Fixes # (issue)

If there is not an issue for this, please create one first. This is used to tracking purposes and also helps use understand why this PR exists

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Chore (refactoring code, technical debt, workflow improvements)
  • Enhancement (small improvements)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How should this be tested?

  • Test A
  • Test B

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read Contributing Guide
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand areas
  • Ran pnpm build
  • Ran pnpm fmt
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues

Appreciated

  • If a UI change was made: Added a screen recording or screenshots to this PR
  • Updated the Unkey Docs if changes were necessary

Summary by CodeRabbit

  • New Features

    • Added an optional tags filter to verification timeseries queries.
  • Tests

    • Updated tests to cover tag-filter behavior and streamlined query formatting.
  • Chores

    • Improved CI unit test workflow with Docker support and environment setup to enhance reliability.

Copy link

changeset-bot bot commented Aug 14, 2025

⚠️ No Changeset found

Latest commit: 633874a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Aug 14, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
dashboard Ready Preview Comment Aug 14, 2025 9:25pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
engineering ⬜️ Ignored Preview Aug 14, 2025 9:25pm

Copy link
Contributor

coderabbitai bot commented Aug 14, 2025

📝 Walkthrough

Walkthrough

Updates CI unit test workflow to set up Docker/Testcontainers and install Goose CLI. Adjusts a ClickHouse test to pass a new tags parameter (null) to verifications.timeseries.perDay and performs minor SQL formatting changes.

Changes

Cohort / File(s) Summary
CI workflow: Docker/Testcontainers setup and Goose install
.github/workflows/job_test_unit.yaml
Adds Docker Buildx setup, Docker socket permissions/verification, Goose CLI v3.20.0 installation, and Testcontainers-related env vars (TESTCONTAINERS_RYUK_DISABLED, DOCKER_HOST, TESTCONTAINERS_HOST_OVERRIDE) for the test step.
ClickHouse test: tags parameter and formatting
internal/clickhouse/src/verification_outcomes_propagate_correctly.test.ts
Passes tags: null to verifications.timeseries.perDay and adjusts SQL string formatting; reflects an updated perDay signature to accept an optional tags parameter.

Sequence Diagram(s)

sequenceDiagram
  actor Dev as Developer
  participant GH as GitHub Actions (Unit Tests)
  participant Docker as Docker Engine
  participant Goose as Goose CLI
  participant Tests as Test Runner

  Dev->>GH: Push/PR triggers unit tests
  GH->>GH: Setup Buildx
  GH->>Docker: Configure socket permissions
  GH->>GH: Install Goose CLI (v3.20.0)
  GH->>Tests: Run tests with Testcontainers env\n(RYUK_DISABLED, DOCKER_HOST, HOST_OVERRIDE)
  Tests->>Docker: Start containers as needed
  Tests-->>GH: Report results
Loading
sequenceDiagram
  participant Test as ClickHouse Test
  participant TS as verifications.timeseries
  participant CH as ClickHouse

  Test->>TS: perDay({ ..., tags: null })
  TS->>CH: Execute timeseries query (tags param considered)
  CH-->>TS: Rows
  TS-->>Test: Aggregated per-day results
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • mcstepp
  • ogzhanolguncu
  • MichaelUnkey
  • chronark

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch tests-are-dumb-delete-them

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

github-actions bot commented Aug 14, 2025

Thank you for following the naming conventions for pull request titles! 🙏

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🔭 Outside diff range comments (1)
internal/clickhouse/src/verification_outcomes_propagate_correctly.test.ts (1)

147-161: Exercise the new tags parameter in the perDay timeseries test and assert DB ↔ API parity

Short: perDay already accepts null (verificationTimeseriesParams uses z.array(...).nullable()). Update the test to (1) call perDay with an explicit tag filter using the correct shape and assert identical results, and (2) assert the DB aggregates (directAggregateData) match expectedOutcomes.

Files / locations:

  • internal/clickhouse/src/verification_outcomes_propagate_correctly.test.ts — around the perDay call (lines ~147–161) and the block where dbAggregates is computed but not asserted.
  • internal/clickhouse/src/verifications.ts — verificationTimeseriesParams shows tags is nullable (no change required, just confirming the API accepts null).

Suggested changes (insert after the existing perDay call and add the DB assertion where dbAggregates is built):

  1. Exercise tag filter (correct shape: { operator, value }):
const dailyWithTagFilter = await ch.verifications.timeseries.perDay({
  workspaceId,
  keyspaceId: keySpaceId,
  keyId,
  startTime: start - interval,
  endTime: end + interval,
  identities: null,
  keyIds: null,
  names: null,
  outcomes: null,
  tags: [{ operator: "is", value: "tag" }],
});

if (daily && dailyWithTagFilter) {
  expect(dailyWithTagFilter.length).toBe(daily.length);
  const sum = (buckets: typeof daily) =>
    buckets.reduce(
      (acc, b) =>
        acc +
        (b.y.valid_count ?? 0) +
        (b.y.rate_limited_count ?? 0) +
        (b.y.disabled_count ?? 0),
      0,
    );
  expect(sum(dailyWithTagFilter)).toBe(sum(daily));
}
  1. Assert DB vs API parity where dbAggregates is constructed:
if (directAggregateData && directAggregateData.length > 0) {
  const dbAggregates = {
    VALID: 0,
    RATE_LIMITED: 0,
    DISABLED: 0,
  };
  directAggregateData.forEach((row) => {
    if (row.outcome in dbAggregates) {
      dbAggregates[row.outcome as keyof typeof dbAggregates] = row.total;
    }
  });
  expect(dbAggregates).toStrictEqual(expectedOutcomes);
}

Notes:

  • The correct tags parameter shape is an array of { operator: "is" | "contains" | "startsWith" | "endsWith", value: string } — do not pass plain string arrays.
  • I verified verificationTimeseriesParams declares tags as .nullable(), so passing null is explicit and valid.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these settings in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 6024e32 and 633874a.

📒 Files selected for processing (2)
  • .github/workflows/job_test_unit.yaml (2 hunks)
  • internal/clickhouse/src/verification_outcomes_propagate_correctly.test.ts (3 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit Inference Engine (CLAUDE.md)

**/*.{js,jsx,ts,tsx}: Use Biome for formatting and linting in TypeScript/JavaScript projects
Prefer named exports over default exports in TypeScript/JavaScript, except for Next.js pages

Files:

  • internal/clickhouse/src/verification_outcomes_propagate_correctly.test.ts
**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (CLAUDE.md)

**/*.{ts,tsx}: Follow strict TypeScript configuration
Use Zod for runtime validation in TypeScript projects

Files:

  • internal/clickhouse/src/verification_outcomes_propagate_correctly.test.ts
**/*.test.{ts,tsx}

📄 CodeRabbit Inference Engine (CLAUDE.md)

Use Vitest for unit and integration tests in TypeScript projects

Files:

  • internal/clickhouse/src/verification_outcomes_propagate_correctly.test.ts
**/*.{env,js,ts,go}

📄 CodeRabbit Inference Engine (CLAUDE.md)

All environment variables must follow the format: UNKEY_<SERVICE_NAME>_VARNAME

Files:

  • internal/clickhouse/src/verification_outcomes_propagate_correctly.test.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Test Go API Local / Test
  • GitHub Check: Test API / API Test Local
  • GitHub Check: Build / Build
🔇 Additional comments (2)
internal/clickhouse/src/verification_outcomes_propagate_correctly.test.ts (2)

90-97: SQL formatting cleanup looks good.

Readability improved; no semantic changes. The filter conditions remain identical.


119-126: LGTM on aggregate query formatting.

Same query semantics with cleaner SELECT/WHERE layout.

@imeyer
Copy link
Contributor

imeyer commented Aug 14, 2025

I don't disagree with rabbit, but at the same time.. if it makes the test go green... :shipit:

@imeyer imeyer self-requested a review August 14, 2025 21:56
Copy link
Contributor

@imeyer imeyer left a comment

Choose a reason for hiding this comment

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

LGTM

maybe coderabbit can make me a ticket for the cleanup items from the review?

Copy link

graphite-app bot commented Aug 15, 2025

Ad gif. Sitting in front of an old computer, '90s child actor Brent Rambo gives a robust thumbs up to the camera, his mouth a confident upside-down crescent. His autograph is superimposed onto the scene, giving the impression that his stamp of approval truly matters.  (Added via Giphy)

Copy link

graphite-app bot commented Aug 15, 2025

Graphite Automations

"Post a GIF when PR approved" took an action on this PR • (08/15/25)

1 gif was posted to this PR based on Andreas Thomas's automation.

@Flo4604 Flo4604 added this pull request to the merge queue Aug 15, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 15, 2025
@Flo4604 Flo4604 added this pull request to the merge queue Aug 15, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 15, 2025
@Flo4604 Flo4604 added this pull request to the merge queue Aug 15, 2025
Merged via the queue into main with commit 24234ef Aug 15, 2025
18 checks passed
@Flo4604 Flo4604 deleted the tests-are-dumb-delete-them branch August 15, 2025 16:17
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