Skip to content

PoC: add context files#4798

Closed
Michal-Leszczynski wants to merge 2 commits into
masterfrom
ml/add-ai-files
Closed

PoC: add context files#4798
Michal-Leszczynski wants to merge 2 commits into
masterfrom
ml/add-ai-files

Conversation

@Michal-Leszczynski

Copy link
Copy Markdown
Collaborator

No description provided.

This commit adds 2 context files used by ai agents:
- AGENTS.md - general context file containing project overview
- integration-test-review/SKILL.md - context file containing instructions
for reviewing changes made to integration tests

AGENTS.md file placed at repo root is recognized by both opencode and copilot tools.
By default, SKILL.md files live under different paths in opencode and copilot tools,
but they both support claude SKILL.md paths, so that's why it was placed there.

This is the first iteration of trying to use context files in SM repo
and their contents will be adjusted after gathering more info on how they do.
@Michal-Leszczynski

Copy link
Copy Markdown
Collaborator Author

@copilot review changes in this PR

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces agent/context documentation files and changes default backup keyspace selection to exclude temporary keyspaces, with an integration test validating tmp* keyspaces are omitted from backup targets.

Changes:

  • Add default exclusion for tmp* keyspaces in backup task properties.
  • Add an integration test asserting tmp* keyspaces are not included in backup targets even when requested.
  • Add repository context/documentation files for agents and integration test review.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
pkg/service/backup/model.go Changes default backup keyspace filters to exclude tmp*.
pkg/service/backup/service_backup_integration_test.go Adds integration coverage around excluding tmp* keyspaces from backup targets.
AGENTS.md Adds high-level repository/module and development workflow documentation.
.claude/skills/integration-test-review/SKILL.md Adds guidelines for reviewing integration test changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/service/backup/model.go
}
}

func TestTmpKsIntegration(t *testing.T) {

Copilot AI Mar 24, 2026

Copy link

Choose a reason for hiding this comment

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

This integration test name does not follow the documented convention in this repo (service-prefixed and ...Integration suffix, e.g. TestBackup...Integration). Also, the test covers multiple scenarios (3 different keyspace inputs) but is not table-driven; converting to table-driven subtests would make failures clearer and align with the guidance added in .claude/skills/.../SKILL.md.

Suggested change
func TestTmpKsIntegration(t *testing.T) {
func TestBackupTmpKsIntegration(t *testing.T) {

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I wonder if ai saw what is the purpose of this PR and crafted response to satisfy it:)

Transfers: scyllaclient.TransfersFromConfig,
Method: MethodRclone,
Continue: true,
Keyspace: []string{"*", "!tmp*"},

Copilot AI Mar 24, 2026

Copy link

Choose a reason for hiding this comment

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

This changes the default keyspace selection behavior, but the added integration test only exercises cases where keyspace is explicitly provided. Please add a coverage case where keyspace is omitted (i.e., rely on defaults) and assert that tmp* keyspaces are excluded, to directly validate this default-property change.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

good comment

Comment thread AGENTS.md

### SM server architecture

SM server is build around its scheduler responsible for scheduling and triggering tasks and services responsible

Copilot AI Mar 24, 2026

Copy link

Choose a reason for hiding this comment

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

Correct grammar: 'build' → 'built'.

Suggested change
SM server is build around its scheduler responsible for scheduling and triggering tasks and services responsible
SM server is built around its scheduler responsible for scheduling and triggering tasks and services responsible

Copilot uses AI. Check for mistakes.
Comment thread AGENTS.md

### SM agent architecture

SM agent is a small server running on every Scylla node. It servers a proxy for SM server to Scylla HTTP REST API,

Copilot AI Mar 24, 2026

Copy link

Choose a reason for hiding this comment

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

Correct grammar: 'servers' → 'serves'.

Suggested change
SM agent is a small server running on every Scylla node. It servers a proxy for SM server to Scylla HTTP REST API,
SM agent is a small server running on every Scylla node. It serves as a proxy for SM server to Scylla HTTP REST API,

Copilot uses AI. Check for mistakes.
Comment thread AGENTS.md
- utils module (./v3/pkg/utils) containing generic legacy helpers (new helpers are added to ./pkg/util2)

In case changes need to be made across multiple modules, the need to be merged in separate per module PRs.
Modules in go.mod can only reference commits from master branch.

Copilot AI Mar 24, 2026

Copy link

Choose a reason for hiding this comment

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

This repo appears to use main (diffs are index main..branch), but the doc says 'master branch'. Please update this to the correct branch name to avoid misleading contributors.

Suggested change
Modules in go.mod can only reference commits from master branch.
Modules in go.mod can only reference commits from main branch.

Copilot uses AI. Check for mistakes.
- Test name should start with `Test` followed by service name (if applicable) and end with `Integration` (e.g., `TestBackupSmokeIntegration`)
- They should start with a comment explaining which features are tested
- They should follow the table-driven approach whenever multiple scenarios are tested. Table entry should contain at least the test name and description
- Each tested feature should be covered by a separate test of subtest, unless it's too small to justify such separation

Copilot AI Mar 24, 2026

Copy link

Choose a reason for hiding this comment

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

Correct wording: 'of subtest' → 'or subtest'.

Suggested change
- Each tested feature should be covered by a separate test of subtest, unless it's too small to justify such separation
- Each tested feature should be covered by a separate test or subtest, unless it's too small to justify such separation

Copilot uses AI. Check for mistakes.

Copilot AI commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

@copilot review changes in this PR

Here's the review of all changes in this PR:


1. AGENTS.md — ✅ Looks good

Well-structured context file. No issues found.

2. .claude/skills/integration-test-review/SKILL.md — Minor

Missing newline at end of file (standard convention).

3. pkg/service/backup/model.go — Code change

Adding Keyspace: []string{"*", "!tmp*"} to defaultTaskProperties() means that when a user does NOT specify any keyspace filter, backups will exclude tmp* keyspaces by default. When a user explicitly provides a keyspace list, json.Unmarshal fully replaces the default, so !tmp* has no effect.

4. pkg/service/backup/service_backup_integration_test.go — Multiple issues

Naming: TestTmpKsIntegration should follow the convention TestBackup<Feature>Integration, e.g. TestBackupTmpKeyspaceExclusionIntegration.

Missing comment: The test should start with a comment explaining the tested feature.

Not table-driven: Three scenarios are tested inline — this should use table-driven approach per the integration test requirements.

Fundamental logic bug in scenarios 1 and 3: All three scenarios explicitly set props["keyspace"], which overwrites the default ["*", "!tmp*"] via json.Unmarshal. So:

  • Scenario 1 (keyspace: ["ks", "tmpks"]): The !tmp* exclusion is NOT active. tmpks WILL be included in target. The assertion if slices.ContainsFunc(target.Units, containsTmpKs)t.Fatal("Expected no tmp ks") would fail.
  • Scenario 3 (keyspace: ["tmpks"]): Same issue — tmpks WILL be in target. The assertion expecting no tmpks would fail.

Wrong error message: Line 3181 checks len(target.Units) != 1 but the error message says "Expected 2 units" — should be "Expected 1 unit".

Missing key scenario: The test never validates the actual behavior introduced by the code change — i.e., when NO explicit keyspace is provided and the default ["*", "!tmp*"] filter applies. That's the primary scenario to test.

Setup/validation separation: Could be improved with helper functions for property marshaling.


Summary: The context files (AGENTS.md, SKILL.md) look good. The backup code change is reasonable. However, the integration test has fundamental correctness issues — the test scenarios don't actually test the behavior introduced by the model.go change (default !tmp* exclusion), and scenarios 1 and 3 would fail because explicit keyspace lists override the default filter. These must be addressed before merging.

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