Skip to content

Commit 169bd58

Browse files
authored
Merge pull request #1258 from tychtjan/third_cassette
DX-319: build: replace AIO with microservices docker-compose
2 parents 6674e38 + 09a85b2 commit 169bd58

File tree

260 files changed

+11327
-45397
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

260 files changed

+11327
-45397
lines changed

.cursor/rules/cursor/rules.mdc

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
# (C) 2025 GoodData Corporation
12
---
2-
description: How to create or update Cursor rule files - minimal templates and standards
3+
description: How to create or update Cursor rule files - includes minimal templates and standards
34
alwaysApply: false
45
---
56

@@ -10,19 +11,21 @@ alwaysApply: false
1011
- `.cursor/rules/general/` - General rules (always applied)
1112
- `.cursor/rules/packages/` - Package-specific rules
1213
- `.cursor/rules/technologies/` - Technology rules (Python, testing)
14+
- `.cursor/rules/guides/shared/` - Shared conventions (commits, etc.)
1315
- `.cursor/rules/cursor/` - Cursor workflow and meta-rules
1416

1517
## Rule Creation Process
1618

17-
1. **Ask for clarification** if codebase location unclear
19+
1. **Ask for clarification** if codebase location is unclear
1820
2. **Investigate the codebase** relevant to the rule
1921
3. **Look at similar existing rules** as examples (better than templates)
2022
4. **Keep it minimal** - target 25-40 lines max
2123
5. **Focus on proprietary knowledge** - not generic patterns
24+
6. **Remove anything that doesn't help Cursor** - do not put anything that doesn't help Cursor into any rule file
2225

2326
## Updating Existing Rules
2427

25-
**CRITICAL**: Be MINIMAL. Add only what prevents actual errors.
28+
**CRITICAL**: When asked to extend rules, be MINIMAL. Add only what prevents actual errors.
2629

2730
**DO (Minimal):**
2831
```python
@@ -42,23 +45,42 @@ if TYPE_CHECKING:
4245
- ❌ Step-by-step tutorials
4346
- ❌ Verbose "correct vs wrong" comparisons
4447

45-
**Rule of thumb**: If it didn't cause a validation error, don't add it.
48+
**Rule of thumb**: If it didn't cause a validation error, don't add it to the rule.
4649

47-
**Target length**: 25-40 lines. If over 50 lines, too verbose.
50+
**Target length**: 25-40 lines. If over 50 lines, you're being too verbose.
4851

49-
## Rule Structure
52+
## Rule Structure (All Types)
5053

5154
**Essential sections:**
5255
- Description header (1 line)
5356
- Owns / Does NOT Own (clear boundaries)
54-
- Critical constraints (if any)
55-
- Dependencies
57+
- Critical constraints or anti-patterns (if any)
58+
- Dependencies (required rules to load together)
59+
60+
**Optional sections:**
61+
- Integration (only if complex)
62+
- Proprietary patterns (only if non-obvious)
63+
- Essential commands (only if unique to this package)
64+
65+
## Quality Criteria
66+
67+
**Good rule (25-40 lines):**
68+
- ✅ Only proprietary/non-obvious knowledge
69+
- ✅ Clear package boundaries
70+
- ✅ Points to READMEs for details
71+
- ✅ Copy-paste ready patterns (minimal examples)
72+
73+
**Bad rule (>50 lines):**
74+
- ❌ Generic technology descriptions
75+
- ❌ Long explanations or tutorials
76+
- ❌ Verbose examples with commentary
77+
- ❌ Information already in code/docs
5678

5779
## Rule Header Format
5880

5981
```markdown
6082
---
61-
description: {Brief - used by Cursor for rule selection}
62-
alwaysApply: false # (true only for general rules)
83+
description: {Brief but complete - used by Cursor for rule selection}
84+
alwaysApply: false # (or true only for general rules)
6385
---
6486
```
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
1+
# (C) 2025 GoodData Corporation
12
---
23
description: Cursor IDE workflow validation and rule management
34
alwaysApply: true
45
---
56

67
# Cursor IDE Workflow Validation
78

8-
## Workflow Constraints
9+
## Workflow and output constraints
910

1011
- Include all rules related to the user question; if rules mention dependencies, include those too.
1112
- After fully answering, report the list of used rules.
1213
- Example: **Used rules**: general/general, technologies/python, packages/gooddata-sdk
1314
- Do not print rule previews or long plans.
1415
- Keep status updates to one short sentence.
1516
- Never inline full rule contents; reference by rule path only when needed.
17+
- Only list rule IDs in "Used rules:".
1618

17-
## Rule Search
19+
## Rule Search Requirements
1820

19-
Always look for relevant cursor rules based on the character of changes.
21+
Always look for relevant cursor rules in this repository based on the character of the changes.
22+
Do not inline rule contents; reference rules by path only when necessary.
23+
24+
## Git Commit Requirements
25+
26+
Follow commit message format from `guides/shared/commits.mdc`.

.cursor/rules/general/general.mdc

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
# (C) 2025 GoodData Corporation
12
---
23
alwaysApply: true
34
---
45

56
# GoodData Python SDK Coding Guidelines
67

78
Applies to all packages and code in this Python SDK workspace.
8-
Think in steps before changes. Search for relevant cursor rules based on the character of changes.
9+
Think in steps before changes. Always search for relevant cursor rules based on the character of changes.
910

1011
## Core Principles
1112

@@ -15,11 +16,17 @@ Think in steps before changes. Search for relevant cursor rules based on the cha
1516

1617
## ⚠️ CRITICAL: AI Behavior Rules - ALWAYS ENFORCE
1718

18-
**NO AUTO-IMPLEMENTATION**:
19+
**NO AUTO-IMPLEMENTATION**:
20+
- Do not generate, rename or refactor what is not explicitly requested
1921
- Do not generate code changes unless user explicitly asks for it
20-
- NEVER create summary/documentation markdown files unless explicitly requested
22+
- NEVER create summary/documentation markdown files unless user explicitly requests it
23+
- NEVER update rule files for code issues - fix the code instead
2124
- Break complex tasks into smaller deliverable units
2225

26+
**Documentation Quality**:
27+
- NEVER reference specific line numbers (e.g., "lines 45-340", "~line 60") in documentation or Cursor rules
28+
- Use descriptive structural locations instead (e.g., "in the outputs section", "at the top of the file")
29+
2330
**For complex tasks**:
2431
1. Implement ONLY the first task, then STOP
2532
2. Ask permission to continue, offering: (a) next task only, or (b) all remaining tasks
@@ -28,20 +35,23 @@ Think in steps before changes. Search for relevant cursor rules based on the cha
2835

2936
## Code Validation
3037

31-
**If gdc-ruler MCP server is available**: Use `validate_python` tool with this workspace path.
32-
```
33-
validate_python(path=".") # From workspace root
34-
```
35-
36-
**Otherwise**: Run manually:
38+
**MANDATORY after code changes**: Run validation from workspace root:
3739
```bash
38-
make format-fix && make mypy && make test
40+
make format-fix && make lint && make mypy && make test
3941
```
4042

43+
**⚠️ CRITICAL: Do NOT use `read_lints` tool**:
44+
- `read_lints` is incompatible with our custom linting - it will fail
45+
- Use manual validation commands above
46+
4147
**Scoped testing**: `TEST_ENVS=py312 ADD_ARGS="-k test_name" make test`
4248

4349
See `technologies/testing` rule for VCR cassette workflow.
4450

51+
## Testing Practices
52+
53+
**Extend existing tests, don't create new ones**: When making incremental changes (new property, enum value, field), add to existing test fixtures rather than creating new tests.
54+
4555
## Package Structure
4656

4757
**Workspace packages** (in `packages/`):
@@ -61,10 +71,15 @@ See `technologies/testing` rule for VCR cassette workflow.
6171

6272
## OpenAPI Client Generation
6373

64-
**DO NOT manually edit** generated client code in `gooddata-*-client/` directories.
74+
**DO NOT manually edit** generated client code in `gooddata-api-client/` directories.
75+
76+
To regenerate: `make api-client`
6577

66-
See `.openapi-generator/README.md` for regeneration instructions.
78+
## Library Integration
6779

68-
## Fast-Changing Dependencies
80+
**Hierarchy** (combat outdated LLM knowledge):
81+
1. **Internal GoodData packages** - ALWAYS preferred
82+
2. **Approved stable libraries** - Use versions from pyproject.toml
83+
3. **New/unknown libraries** - MANDATORY: web search for current docs/APIs before suggesting
6984

70-
**When suggesting third-party libraries**: Verify current APIs, prefer established libraries, check Python 3.10+ compatibility.
85+
When suggesting third-party libraries: verify current APIs, prefer established libraries, explicitly state uncertainty.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# (C) 2025 GoodData Corporation
2+
---
3+
description: Git commit conventions - conventional commits format
4+
alwaysApply: false
5+
---
6+
7+
# Commit Conventions
8+
9+
Commits must follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0) specification.
10+
11+
## Format
12+
13+
```
14+
<type>(<scope>): <description>
15+
16+
<body>
17+
18+
jira: <ticket-number>
19+
risk: <risk-flag>
20+
```
21+
22+
## Type
23+
24+
Must be one of:
25+
- `feat` - A new feature
26+
- `fix` - A bug fix
27+
- `build` - Changes to build system or dependencies
28+
- `ci` - Changes to CI configuration
29+
- `docs` - Documentation changes
30+
- `perf` - Performance improvements
31+
- `style` - Formatting changes (no code change)
32+
- `refactor` - Code change that neither fixes a bug nor adds a feature
33+
- `test` - Adding or correcting tests
34+
- `chore` - Other changes that don't modify src or test files
35+
- `revert` - Revert previous changes
36+
37+
## Scope
38+
39+
Optional. The affected package name (e.g., `gooddata-sdk`, `gooddata-pandas`, `gooddata-dbt`).
40+
41+
## Description
42+
43+
- Max 50 characters (full line ≤ 70 chars)
44+
- Lowercase, imperative mood
45+
- No period at end
46+
47+
## Body
48+
49+
Optional detailed explanation. Wrap lines at 72 characters.
50+
51+
## Footer (Required)
52+
53+
- `jira: PROJECT-ID` or `jira: trivial` for minor changes
54+
- `risk: nonprod|low|high`
55+
56+
## Example
57+
58+
```
59+
feat(gooddata-sdk): add workspace permission methods
60+
61+
Add new methods to catalog_permission service for managing
62+
workspace-level permissions programmatically.
63+
64+
jira: RAIL-12345
65+
risk: low
66+
```
67+
68+
## Dependencies
69+
70+
Related: general/general

.cursor/rules/packages/gooddata-pandas.mdc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# (C) 2025 GoodData Corporation
12
---
23
description: GoodData Pandas package - pandas integration layer for GoodData SDK
34
alwaysApply: false
@@ -15,6 +16,7 @@ alwaysApply: false
1516
## Does NOT Own
1617

1718
- Core SDK functionality → gooddata-sdk package
19+
- API client → gooddata-api-client (generated)
1820

1921
## Architecture
2022

@@ -31,6 +33,10 @@ gp = GoodPandas(host="https://example.gooddata.com", token="...")
3133
df = gp.data_frames(workspace_id="demo", insight_id="...")
3234
```
3335

36+
## Testing
37+
38+
Uses vcrpy cassettes. See `technologies/testing` rule for workflow.
39+
3440
## Dependencies
3541

3642
Required: technologies/python, packages/gooddata-sdk

.cursor/rules/packages/gooddata-sdk.mdc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# (C) 2025 GoodData Corporation
12
---
23
description: GoodData SDK core package - primary interface for GoodData Cloud
34
alwaysApply: false
@@ -42,6 +43,8 @@ workspaces = sdk.catalog_workspace.list_workspaces()
4243

4344
Uses vcrpy cassettes. See `technologies/testing` rule for workflow.
4445

46+
**Extend existing tests** when adding new functionality - don't create new test files for minor changes.
47+
4548
## Dependencies
4649

4750
Required: technologies/python, technologies/testing

.cursor/rules/technologies/python.mdc

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,53 @@
1+
# (C) 2025 GoodData Corporation
12
---
2-
description: Python development - mypy-clean code patterns
3+
description: Python development - mypy-clean code patterns and typing
34
alwaysApply: false
45
---
56

6-
# Python Development
7+
# Python Development Guidelines
78

89
**Goal:** Ship mypy-clean code on first pass. No "write → validate → fix" loops.
910

1011
**Supported versions**: Python 3.10 and higher
1112

1213
## Imports
1314

14-
**Absolute imports only.** Relative imports break monorepo navigation.
15+
**Use absolute imports only.** Relative imports break IDE navigation.
1516
```python
1617
from gooddata_sdk.client import GoodDataSdk # ✅
1718
from .client import GoodDataSdk # ❌
1819
```
1920

20-
**All imports at top of file.** After docstring and `from __future__ import annotations`.
21-
22-
## Type-first Habits
21+
**All imports must be at the top of the file.** Never import modules inside functions or in the middle of code. All `import` and `from ... import` statements must be placed at the top of the file, after the module docstring and `from __future__ import annotations` if present.
2322

23+
## Type-first habits
2424
- Every def + local (esp empty list/dict/set) annotated; dataclasses fully typed.
2525
- Use `from __future__ import annotations` for forward references.
26-
- Guard external data (YAML/JSON) as `Any` then narrow types.
27-
28-
## External Data (YAML/JSON)
29-
30-
```python
31-
raw = yaml.safe_load(handle)
32-
if not isinstance(raw, dict):
33-
raise ValueError("expected mapping")
34-
cfg: dict[str, object] = {str(k): v for k, v in raw.items()}
35-
```
36-
37-
## Casts / Guards
38-
39-
- Single authoritative `cast(...)` + reuse variable
40-
- Guard pattern: `if isinstance(mode_raw, str): mode = mode_raw else: raise ValueError("...")`
41-
- `typing.assert_never` for exhaustive branches
42-
43-
## Validation flow (If MCP server installed)
44-
- Python-only chores: `validate_python(path)` (format, lint, types, test).
45-
- Mixed stacks: run Python + Kotlin validators separately; skip umbrella `validate` until new classifier routing lands.
26+
- Helpers when default mutable needed:
27+
```python
28+
def _new_set() -> set[str]:
29+
return set()
30+
```
31+
32+
## External data (YAML/JSON/etc.)
33+
- Treat loader output as `Any`; guard then normalize keys:
34+
```python
35+
raw = yaml.safe_load(handle)
36+
if not isinstance(raw, dict):
37+
raise ValueError("expected mapping")
38+
cfg: dict[str, object] = {str(k): v for k, v in raw.items()}
39+
```
40+
- Narrow collections once: `entries = [x for x in cast(list[object], cfg.get("items", [])) if isinstance(x, str)]`.
41+
- Prefer `TypedDict`/dataclass when schema known.
42+
43+
## Logging & diagnostics
44+
- Never log raw `Any`; cast or pre-format (`logger.warning("… %r", safe)`).
45+
- Avoid redundant `isinstance` after data narrowed; mypy flags it.
46+
47+
## Casts / guards
48+
- Single authoritative `cast(...)` + reuse variable.
49+
- Guard pattern: `if isinstance(mode_raw, str): mode = mode_raw else: raise ValueError("mode str")`.
50+
- `typing.assert_never` for exhaustive branches.
4651

4752
## Documentation
4853

0 commit comments

Comments
 (0)