Skip to content

Auto-generated Pull Request for fix/list-plasmids-expression#611

Merged
cybersiddhu merged 17 commits into
developfrom
fix/list-plasmids-expression
Apr 21, 2026
Merged

Auto-generated Pull Request for fix/list-plasmids-expression#611
cybersiddhu merged 17 commits into
developfrom
fix/list-plasmids-expression

Conversation

@cybersiddhu
Copy link
Copy Markdown
Member

@cybersiddhu cybersiddhu commented Apr 21, 2026

Pulling 'fix/list-plasmids-expression into develop. Please review and merge.

Summary by CodeRabbit

  • Documentation

    • Updated developer documentation and workflows.
  • Bug Fixes

    • Enhanced validation for plasmid filtering to provide clearer error messages for unsupported filter options.

The project-specific coding guidelines are being removed from the
repository to avoid duplication or potential drift from standard Go
practices and to simplify the documentation maintenance.
- Replace cascading state structs with tuple-based pipeline
- Streamline filter build process
- Add validation for plasmid list filters (id, in_stock)

💘 Generated with Crush

Assisted-by: Google: Gemini 3.1 Flash Lite Preview via Crush <crush@charm.land>
- Include testing instructions with gotestsum
- Include linting and formatting commands using golangci-lint

💘 Generated with Crush

Assisted-by: Google: Gemini 3.1 Flash Lite Preview via Crush <crush@charm.land>
Move the plasmid type validation and state building logic out of the
buildListPlasmidFilterQuery pipeline into validateAndBuildPlasmidFilter.

💘 Generated with Crush

Assisted-by: Google: Gemini 3 Flash Preview via Crush <crush@charm.land>
Update limit, cursor, and total fields in plasmidResultContext to use
domain-specific types for better alignment with the resolver pipeline.

💘 Generated with Crush

Assisted-by: Google: Gemini 3 Flash Preview via Crush <crush@charm.land>
…nPair

💘 Generated with Crush

Assisted-by: Google: Gemini 3 Flash Preview via Crush <crush@charm.land>
…ationPair

💘 Generated with Crush

Assisted-by: Google: Gemini 3 Flash Preview via Crush <crush@charm.land>
…a filterValidationPair

💘 Generated with Crush

Assisted-by: Google: Gemini 3 Flash Preview via Crush <crush@charm.land>
…-free validation chain

💘 Generated with Crush

Assisted-by: Google: Gemini 3 Flash Preview via Crush <crush@charm.land>
💘 Generated with Crush

Assisted-by: Google: Gemini 3 Flash Preview via Crush <crush@charm.land>
…er chain

💘 Generated with Crush

Assisted-by: Google: Gemini 3 Flash Preview via Crush <crush@charm.land>
…ipeline

- Refactor ListPlasmids resolver into a point-free IOEither chain.
- Simplify buildListPlasmidFilterQuery validation chain.
- Add pipeline helpers for error and result folding.

💘 Generated with Crush

Assisted-by: Google: Gemini 3 Flash Preview via Crush <crush@charm.land>
Convert plasmid ID nil check into an Either validator and chain it
within the buildListPlasmidFilterQuery pipeline for better consistency.

💘 Generated with Crush

Assisted-by: Google: Gemini 3 Flash Preview via Crush <crush@charm.land>
…e function

- Move validateAndBuildPlasmidFilter out of the var block
- Simplify plasmid type filter query to use direct tag matching

💘 Generated with Crush

Assisted-by: Google: Gemini 3 Flash Preview via Crush <crush@charm.land>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

Warning

Rate limit exceeded

@cybersiddhu has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 45 minutes and 2 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 45 minutes and 2 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 524d248e-2457-4c37-9d22-123728e938e2

📥 Commits

Reviewing files that changed from the base of the PR and between 2c9b62f and 5de59cb.

📒 Files selected for processing (1)
  • internal/graphql/resolver/stock_test.go
📝 Walkthrough

Walkthrough

Documentation updated by replacing CLAUDE.md with AGENTS.md (developer workflows). The plasmid list resolver pipeline refactored from tuple/context enrichment to multi-stage listPlasmidsContext approach with explicit filter validation, error handling for invalid filters, and registry tag-based query building.

Changes

Cohort / File(s) Summary
Documentation
AGENTS.md, CLAUDE.md
Added developer workflow documentation (Go tests, linting, formatting commands); removed legacy Go conventions file.
Plasmid Resolver Refactoring
internal/graphql/resolver/stock.go, internal/graphql/resolver/stock_plasmid_fp.go
Updated functional pipeline composition (IOE.Let/IOE.BindIOE.Map/IOE.Chain). Replaced tuple-based cursor/limit handling with multi-stage context pipeline. Added filter validation: checks plasmidType.IsValid(), rejects unsupported id/in_stock filters, builds filterQuery using registry tag constants and optional summary/name predicates.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

size/L

Poem

🐰 A curious rabbit refactored the filter,
From tuples so nested to pipelines so clever,
With validation and tags in each stage,
The plasmids now pass through a well-ordered cage.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is vague and uninformative; 'Auto-generated Pull Request for fix/list-plasmids-expression' is a generic template phrase that fails to convey the actual changes (refactored resolver pipeline, filter validation, documentation updates). Replace with a specific, descriptive title summarizing the main change, such as 'Refactor ListPlasmids resolver with functional pipeline and filter validation' or 'Update plasmid list resolver with IOEither pipeline and filter validation'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/list-plasmids-expression

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@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: 2

🧹 Nitpick comments (2)
AGENTS.md (1)

17-17: Path argument ./... may be redundant.

The lint command includes ./... path argument, while the previous documentation specified golangci-lint run without an explicit path. The golangci-lint run command recursively checks the current directory by default, so the ./... argument is typically redundant unless you need to be explicit.

Based on learnings, the established command was: golangci-lint run

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@AGENTS.md` at line 17, The command string "golangci-lint run ./..." is
redundant; update the AGENTS.md entry to use the established, simpler command
"golangci-lint run" by replacing the "golangci-lint run ./..." occurrence with
"golangci-lint run" so the doc matches the default recursive behavior.
internal/graphql/resolver/stock_plasmid_fp.go (1)

62-90: Duplicates existing validators in resolverutils/plasmid_filter.go.

resolverutils.CheckIDField and resolverutils.CheckInStockField already encode the same predicates and error messages. Consider reusing them with a ContraMap/adapter over Pa.Tail instead of re-implementing the logic here, so the "not yet supported" message stays in one place.

♻️ Sketch
// in resolverutils (if not already exported), keep the *PlasmidListFilter-based predicates
// and adapt here:
var (
    checkNilPlasmidIDFilter      = adaptPairValidator(resolverutils.CheckIDField)
    checkNilPlasmidInStockFilter = adaptPairValidator(resolverutils.CheckInStockField)
)

func adaptPairValidator(
    v func(*models.PlasmidListFilter) E.Either[error, *models.PlasmidListFilter],
) func(filterValidationPair) E.Either[error, filterValidationPair] {
    return func(pair filterValidationPair) E.Either[error, filterValidationPair] {
        return E.Map[error](func(*models.PlasmidListFilter) filterValidationPair { return pair })(v(Pa.Tail(pair)))
    }
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/graphql/resolver/stock_plasmid_fp.go` around lines 62 - 90, Replace
the duplicated predicates in checkNilPlasmidIDFilter and
checkNilPlasmidInStockFilter by reusing resolverutils.CheckIDField and
resolverutils.CheckInStockField: create a small adapter that takes a validator
of *models.PlasmidListFilter (resolverutils.CheckIDField / CheckInStockField)
and returns a predicate over filterValidationPair by calling the validator on
Pa.Tail(pair) and mapping the success case back to the original pair (use E.Map
or ContraMap-style mapping). Update checkNilPlasmidIDFilter and
checkNilPlasmidInStockFilter to call this adapter instead of reimplementing the
predicate and error messages so the "not yet supported" logic remains
centralized in resolverutils.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@AGENTS.md`:
- Around line 1-4: AGENTS.md currently only lists essential commands and omits
the repository's previous developer guidance from CLAUDE.md; restore and expand
documentation by adding sections for Coding Conventions (naming, formatting,
Go-specific style rules), Architectural Patterns (service boundaries, module
responsibilities, common package layout), Contribution Guidelines (PR process,
commit message format, review expectations), and Repository Policies (testing,
linting, CI requirements); ensure these sections reference existing conventions
used in the repo (e.g., Go style rules, test frameworks, linters) and mirror the
key guidance that was in CLAUDE.md so contributors have the same standards as
before.
- Around line 8-14: Replace the invalid gotestsum format
"pkgname-and-test-fails" used in the test commands with a valid format (for
example replace it with "pkgname" for package-oriented output or
"standard-verbose" if you need more verbosity) wherever "pkgname-and-test-fails"
appears; also update the AGENTS.md test command examples to use the valid
"testdox" already used for verbose test output if appropriate, and document that
gotestsum must be installed as a dev tool (either add it to go.mod as a
development requirement or add a note that developers must install gotestsum
separately).

---

Nitpick comments:
In `@AGENTS.md`:
- Line 17: The command string "golangci-lint run ./..." is redundant; update the
AGENTS.md entry to use the established, simpler command "golangci-lint run" by
replacing the "golangci-lint run ./..." occurrence with "golangci-lint run" so
the doc matches the default recursive behavior.

In `@internal/graphql/resolver/stock_plasmid_fp.go`:
- Around line 62-90: Replace the duplicated predicates in
checkNilPlasmidIDFilter and checkNilPlasmidInStockFilter by reusing
resolverutils.CheckIDField and resolverutils.CheckInStockField: create a small
adapter that takes a validator of *models.PlasmidListFilter
(resolverutils.CheckIDField / CheckInStockField) and returns a predicate over
filterValidationPair by calling the validator on Pa.Tail(pair) and mapping the
success case back to the original pair (use E.Map or ContraMap-style mapping).
Update checkNilPlasmidIDFilter and checkNilPlasmidInStockFilter to call this
adapter instead of reimplementing the predicate and error messages so the "not
yet supported" logic remains centralized in resolverutils.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 74e2020c-ce8c-4079-a182-b9bfa2447d07

📥 Commits

Reviewing files that changed from the base of the PR and between b825172 and 2c9b62f.

📒 Files selected for processing (4)
  • AGENTS.md
  • CLAUDE.md
  • internal/graphql/resolver/stock.go
  • internal/graphql/resolver/stock_plasmid_fp.go
💤 Files with no reviewable changes (1)
  • CLAUDE.md

Comment thread AGENTS.md
Comment on lines +1 to +4
# AGENTS.md


## Essential Commands
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Document coding conventions and guidelines, not just commands.

The AI summary indicates that the removed CLAUDE.md file contained Go coding conventions and repository guideline documentation (including style rules). This new file only documents essential commands, resulting in a loss of important developer guidance.

Consider adding sections that cover coding standards, architectural patterns, and contribution guidelines to maintain the documentation that was previously available.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@AGENTS.md` around lines 1 - 4, AGENTS.md currently only lists essential
commands and omits the repository's previous developer guidance from CLAUDE.md;
restore and expand documentation by adding sections for Coding Conventions
(naming, formatting, Go-specific style rules), Architectural Patterns (service
boundaries, module responsibilities, common package layout), Contribution
Guidelines (PR process, commit message format, review expectations), and
Repository Policies (testing, linting, CI requirements); ensure these sections
reference existing conventions used in the repo (e.g., Go style rules, test
frameworks, linters) and mirror the key guidance that was in CLAUDE.md so
contributors have the same standards as before.

Comment thread AGENTS.md
Comment on lines +8 to +14
gotestsum --format pkgname-and-test-fails --format-hide-empty-pkg -- ./...

# Test (verbose)
gotestsum --format testdox --format-hide-empty-pkg -- ./...

# Watch mode
gotestsum --watch --format pkgname-and-test-fails --format-hide-empty-pkg -- ./...
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check if gotestsum is used in the project and verify command validity

# Check if gotestsum is in go.mod or referenced elsewhere
rg -n "gotestsum" --type=yaml --type=md --type=go

# Check for any test scripts or Makefile that might define the canonical test command
fd -t f -e mk -e sh -e bash -e zsh --exec rg -l "test"

Repository: dictyBase/graphql-server

Length of output: 323


🏁 Script executed:

# Check if CLAUDE.md exists in the repository
fd -i claude

# Look for CI configuration files
fd -e yml -e yaml | grep -i ci

# Check go.mod for dependencies and tools
head -50 go.mod

Repository: dictyBase/graphql-server

Length of output: 2130


🏁 Script executed:

# Look for Makefile or similar test definitions
fd -e mk

# Search for any references to CI or workflow tests
rg -n "go test" --type=yaml --type=go --type=md -A 2

Repository: dictyBase/graphql-server

Length of output: 50


🌐 Web query:

gotestsum format flags documentation pkgname-and-test-fails testdox

💡 Result:

gotestsum is a Go test runner that wraps go test -json and provides various output formats via the --format flag or GOTESTSUM_FORMAT environment variable. Official documentation is in the GitHub README at https://github.com/gotestyourself/gotestsum. Key formats relevant to the query: - pkgname (default): Prints a line for each package, using icons/color to indicate pass/fail/skip status. Icons customizable via --format-icons or GOTESTSUM_FORMAT_ICONS. For passing packages, shows minimal info; for failing packages, shows number of failures (e.g., "0 failed" implied by pass icon, explicit count for fails). - testdox: Prints a readable sentence for each test using gotestdox (e.g., ✔ TestUserAuth_Login (0.23s), ✖ TestPayment_Stripe (0.92s) --- FAIL: invalid API key). Shows pass/fail with icons and elapsed time. No exact format named "pkgname-and-test-fails" exists in the docs. The pkgname format handles test failures by showing failure counts and details in the post-run summary for failed packages. Use --hide-summary to control summary details (e.g., --hide-summary=skipped). Full list of common formats (run gotestsum --help for all): - dots: character per test - pkgname: line per package (default) - testname: line per test+package - testdox: sentence per test - standard-quiet: go test default - standard-verbose: go test -v Examples: gotestsum --format=pkgname ./... gotestsum --format=testdox ./... After formatted output, a summary shows failures, skips, errors, and DONE line (e.g., DONE 9 tests, 1 failure in 3.2s). Latest version info as of 2026-04-15: v1.13.1-0.20260415004743-3cf14356a16c.

Citations:


Fix invalid gotestsum format flags in test commands.

The test commands in lines 8 and 14 use an invalid format flag: pkgname-and-test-fails does not exist in gotestsum's documented formats. Valid formats are: dots, pkgname, testname, testdox, standard-quiet, and standard-verbose.

Line 11 correctly uses testdox, which is valid. Replace the invalid pkgname-and-test-fails format on lines 8 and 14 with a valid alternative (e.g., pkgname for line 8, or use standard-verbose for verbosity if needed).

Additionally, gotestsum is not listed in go.mod as a dependency, so either add it as a development tool or document that it must be installed separately.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@AGENTS.md` around lines 8 - 14, Replace the invalid gotestsum format
"pkgname-and-test-fails" used in the test commands with a valid format (for
example replace it with "pkgname" for package-oriented output or
"standard-verbose" if you need more verbosity) wherever "pkgname-and-test-fails"
appears; also update the AGENTS.md test command examples to use the valid
"testdox" already used for verbose test output if appropriate, and document that
gotestsum must be installed as a dev tool (either add it to go.mod as a
development requirement or add a note that developers must install gotestsum
separately).

Restore the ontology prefix and the equality operator (==) in the
plasmid filter query to match stock service and test expectations.

💘 Generated with Crush

Assisted-by: Google: Gemini 3 Flash Preview via Crush <crush@charm.land>
Update plasmid type filter queries to use triple equals (===) for
exact matching and adjust unit tests to reflect this change.

💘 Generated with Crush

Assisted-by: Google: Gemini 3 Flash Preview via Crush <crush@charm.land>
Remove ontology prefix from plasmid type filters and use tag=== for
exact matching. Update unit tests to match the simplified format.

💘 Generated with Crush

Assisted-by: Google: Gemini 3 Flash Preview via Crush <crush@charm.land>
@cybersiddhu cybersiddhu merged commit c3a3a7b into develop Apr 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant