Skip to content

chore: sync from monorepo @0fd44c3#24

Open
WomB0ComB0 wants to merge 1 commit intomainfrom
sync/monorepo-0fd44c3
Open

chore: sync from monorepo @0fd44c3#24
WomB0ComB0 wants to merge 1 commit intomainfrom
sync/monorepo-0fd44c3

Conversation

@WomB0ComB0
Copy link
Copy Markdown
Member

@WomB0ComB0 WomB0ComB0 commented May 1, 2026

Automated sync from resq-software/resQ@0fd44c3.

Review before merging — direct pushes to standalone repos are preserved.

Summary by CodeRabbit

  • Chores

    • Updated .gitignore to track previously ignored build artifacts and dependencies.
    • Removed OSV-Scanner vulnerability suppression configurations from project and vendor directories.
  • Style

    • Reformatted code across validation checks, parameter lists, and import statements for improved consistency.
    • Removed clippy lint suppressions.
    • Refactored AccessPolicy to use explicit default implementation instead of derive.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 1, 2026

📝 Walkthrough

Walkthrough

This pull request systematically removes Git ignore rules, vulnerability suppression configurations, and Clippy lint suppressions across the codebase while refactoring validation logic to use explicit comparisons instead of range methods and standardizing code formatting.

Changes

Cohort / File(s) Summary
Configuration & Ignore Files
.gitignore, osv-scanner.toml, vendor/solana-program-test/osv-scanner.toml
Removes all Git ignore rules (build artifacts, dependencies, test artifacts), OSV-Scanner vulnerability ignore configurations, and vendored dependency advisory suppression settings.
Lint Suppression Cleanup
resq-airspace/src/lib.rs, resq-delivery/src/lib.rs
Removes crate-level Clippy lint suppressions for too_many_arguments and diverging_sub_expression, retaining only unexpected_cfgs.
Validation Logic Refactoring
resq-airspace/src/instructions/initialize_property.rs, resq-airspace/src/instructions/record_crossing.rs, resq-delivery/src/instructions/record_delivery.rs
Replaces range-based validation using .contains() method with explicit inclusive comparison operators (>= and <=), maintaining identical bounds and error handling.
Function Signature & Macro Formatting
resq-airspace/src/instructions/grant_permit.rs, resq-airspace/src/instructions/update_policy.rs, resq-airspace/src/instructions/update_treasury.rs
Reformats function parameters and macro invocations from multi-line to single-line forms or vice versa without changing functionality.
Type Implementation Changes
resq-airspace/src/state/airspace_account.rs
Removes Default from AccessPolicy enum derives and adds explicit manual impl Default with Open as default variant.
Test Files Lint & Import Cleanup
resq-airspace/tests/host_init_regression.rs, resq-airspace/tests/integration.rs, resq-delivery/tests/integration.rs
Removes module-level clippy/unused lint suppressions and consolidates Solana imports into grouped blocks; refactors test assertions and instruction construction for formatting consistency.
End-of-File Newline Normalization
resq-airspace/src/error.rs, resq-airspace/src/instructions/grant_permit.rs, resq-airspace/src/instructions/initialize_property.rs, resq-airspace/src/state/airspace_account.rs, resq-airspace/src/state/mod.rs, resq-airspace/src/state/permit.rs, resq-delivery/src/error.rs, resq-delivery/src/instructions/mod.rs, resq-delivery/src/state/delivery_record.rs, resq-delivery/src/state/mod.rs
Removes trailing newlines from multiple source files to standardize EOF formatting.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 Hops with glee through cleaned-up code,
Suppressions shed like winter's load,
Range checks gleam with explicit grace,
Newlines trimmed from every place—
A tidy warren, refactored with care!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: sync from monorepo @0fd44c3' is directly related to the changeset, which consists of an automated sync from a monorepo at the specified commit hash, as indicated in the PR objectives.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sync/monorepo-0fd44c3

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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request performs a broad cleanup of the codebase, including the removal of several configuration files and the downgrading of specific dependencies like rand and rustls-webpki. Significant changes involve removing numerous lint suppressions, simplifying macro usage, and refactoring range validation logic from iterator-based checks to explicit comparisons. Feedback recommends consolidating the repeated coordinate validation logic into a shared utility function to enhance maintainability and adhere to DRY principles.

// Coordinate range validation (mirrors record_delivery).
require!(
(-900_000_000..=900_000_000).contains(&lat),
lat >= -900_000_000 && lat <= 900_000_000,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Using explicit comparison operators for range validation is clear, but consider using clamp or a helper function if this pattern is repeated frequently to improve maintainability.

);
require!(
(-900_000_000..=900_000_000).contains(&lat),
lat >= -900_000_000 && lat <= 900_000_000,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The range validation logic for latitude and longitude is repeated in multiple files. Consider refactoring this into a shared validation utility function to reduce code duplication.

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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@resq-airspace/src/lib.rs`:
- Line 1: Remove the crate-level allow(unexpected_cfgs) and instead apply a
targeted allow for the high-arity Anchor instruction handler: add
#[allow(clippy::too_many_arguments)] to the initialize_property function (the
Anchor instruction handler with 9 parameters) so clippy won't fail the CI while
keeping other lints enabled; keep or re-add unexpected_cfgs only where truly
needed, not at crate level.
🪄 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: 5bb83b2e-122c-44e2-ba7c-e8b9e9f0ab05

📥 Commits

Reviewing files that changed from the base of the PR and between 2ce6f0e and 3df3c65.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (22)
  • .gitignore
  • osv-scanner.toml
  • resq-airspace/src/error.rs
  • resq-airspace/src/instructions/grant_permit.rs
  • resq-airspace/src/instructions/initialize_property.rs
  • resq-airspace/src/instructions/record_crossing.rs
  • resq-airspace/src/instructions/update_policy.rs
  • resq-airspace/src/instructions/update_treasury.rs
  • resq-airspace/src/lib.rs
  • resq-airspace/src/state/airspace_account.rs
  • resq-airspace/src/state/mod.rs
  • resq-airspace/src/state/permit.rs
  • resq-airspace/tests/host_init_regression.rs
  • resq-airspace/tests/integration.rs
  • resq-delivery/src/error.rs
  • resq-delivery/src/instructions/mod.rs
  • resq-delivery/src/instructions/record_delivery.rs
  • resq-delivery/src/lib.rs
  • resq-delivery/src/state/delivery_record.rs
  • resq-delivery/src/state/mod.rs
  • resq-delivery/tests/integration.rs
  • vendor/solana-program-test/osv-scanner.toml
💤 Files with no reviewable changes (3)
  • .gitignore
  • vendor/solana-program-test/osv-scanner.toml
  • osv-scanner.toml

Comment thread resq-airspace/src/lib.rs
clippy::too_many_arguments,
clippy::diverging_sub_expression
)]
#![allow(unexpected_cfgs)]
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 | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

python - <<'PY'
import re
from pathlib import Path

files = [
    Path("resq-airspace/src/lib.rs"),
    Path("resq-airspace/src/instructions/initialize_property.rs"),
]

pattern = re.compile(r'pub fn\s+(\w+)\s*\((.*?)\)\s*->', re.S)

for file in files:
    text = file.read_text()
    print(f"\n== {file} ==")
    for name, args in pattern.findall(text):
        args = re.sub(r'//.*', '', args)
        params = [p.strip() for p in args.split(',') if p.strip()]
        if len(params) > 7:
            print(f"{name}: {len(params)} parameters (likely clippy::too_many_arguments)")
PY

Repository: resq-software/programs

Length of output: 287


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check git history to see what the previous allow statement was
echo "=== Previous version of resq-airspace/src/lib.rs line 1 ==="
git show HEAD~1:resq-airspace/src/lib.rs 2>/dev/null | head -5 || echo "Cannot retrieve previous version"

echo -e "\n=== Current version of resq-airspace/src/lib.rs line 1-5 ==="
head -5 resq-airspace/src/lib.rs

echo -e "\n=== Running cargo clippy --workspace -- -D warnings ==="
cd resq-airspace && cargo clippy --workspace -- -D warnings 2>&1 | head -100 || true

Repository: resq-software/programs

Length of output: 582


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Let's also check the exact signatures of the high-arity functions
echo "=== Checking initialize_property signature ==="
rg -A 15 "pub fn initialize_property" resq-airspace/src/lib.rs

echo -e "\n=== Checking handler signature in instructions ==="
rg -A 15 "pub fn handler" resq-airspace/src/instructions/initialize_property.rs 2>/dev/null || echo "File not found, checking lib.rs"

Repository: resq-software/programs

Length of output: 1126


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check if there are other similar high-arity functions in the codebase
echo "=== Checking all pub fn declarations with parameter counts ==="
rg -A 10 "pub fn" resq-airspace/src/ | grep -E "(pub fn|->)" | head -50

# Check if there are other clippy allow directives in the workspace
echo -e "\n=== Checking for clippy allow directives ==="
rg "clippy::" resq-airspace/src/ || echo "No clippy allows found"

# Check the resq-delivery program for comparison
echo -e "\n=== Checking resq-delivery lib.rs for comparison ==="
head -5 resq-delivery/src/lib.rs 2>/dev/null || echo "File not found"

Repository: resq-software/programs

Length of output: 2018


🏁 Script executed:

#!/bin/bash
set -euo clipfail

# Let's check Cargo.toml to understand the Anchor version and defaults
echo "=== resq-airspace Cargo.toml ==="
head -20 resq-airspace/Cargo.toml

echo -e "\n=== Checking if instruction handlers across codebase follow high-arity pattern ==="
rg "pub fn\s+handler\(" resq-airspace/src/instructions/ -A 1 | head -50

Repository: resq-software/programs

Length of output: 120


Remove crate-level allow(unexpected_cfgs) to prevent clippy CI failures on high-arity instructions.

With cargo clippy --workspace -- -D warnings, the initialize_property function (9 parameters) will trigger clippy::too_many_arguments. The current allow statement only covers unexpected_cfgs; restore protection for Anchor instruction handlers with >7 parameters.

-#![allow(unexpected_cfgs)]
+#![allow(unexpected_cfgs, clippy::too_many_arguments)]

As per coding guidelines: Run cargo clippy --workspace -- -D warnings to catch lints and treat warnings as errors.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#![allow(unexpected_cfgs)]
#![allow(unexpected_cfgs, clippy::too_many_arguments)]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@resq-airspace/src/lib.rs` at line 1, Remove the crate-level
allow(unexpected_cfgs) and instead apply a targeted allow for the high-arity
Anchor instruction handler: add #[allow(clippy::too_many_arguments)] to the
initialize_property function (the Anchor instruction handler with 9 parameters)
so clippy won't fail the CI while keeping other lints enabled; keep or re-add
unexpected_cfgs only where truly needed, not at crate level.

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.

1 participant