Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cursor/skills/gateway-static-js-refactor/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Follow `.cursor/rules/django_javascript_implementation.mdc` in full. Non-negotia

Copy and track:

```
```text
Refactor progress:
- [ ] Baseline (fallow + identify targets)
- [ ] Propose 2–4 scenarios (user picks or hybrid)
Expand Down
4 changes: 2 additions & 2 deletions .cursor/skills/jest-test-writing/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ Config: `sds_gateway/static/js/tests-config/jest.config.js` (jsdom, `clearMocks`

## What to test (and what not to)

**Do**
## Do

- Public methods and user-visible outcomes (DOM updates, calls to `DOMUtils`, `APIClient`, Bootstrap modal show/hide)
- Branches that encode product rules (permissions denied, missing modal, API error responses)
- Async flows: `await` the method under test, then assert mocks/callbacks

**Avoid**
## Avoid

- Asserting private helpers or internal call order unless order is the contract
- Tests that only `expect(x).toBeDefined()` or mirror the implementation line-for-line
Expand Down
20 changes: 10 additions & 10 deletions .github/agent.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ These instructions are to be included in addition to your usual review guideline
## Agent focus and use cases

+ Your review must also assist a human reviewer by highlighting the areas that need
attention, not limited to:
attention, not limited to:
+ Security bounds and vulnerabilities, such as injection flaws, broken
authentication, sensitive data exposure, XML external entities (XXE), broken
access control, security misconfigurations, cross-site scripting (XSS),
insecure deserialization, using components with known vulnerabilities, and
insufficient logging and monitoring.
authentication, sensitive data exposure, XML external entities (XXE), broken
access control, security misconfigurations, cross-site scripting (XSS),
insecure deserialization, using components with known vulnerabilities, and
insufficient logging and monitoring.
+ Subtle bugs and logic errors that static checkers might miss.
+ Potential performance bottlenecks.
+ Antipatterns and code smells.
Expand All @@ -21,19 +21,19 @@ Create a response with the following sections:

1. A summary of the changes made in the pull request.
2. A summary of the project's context, architecture, and design patterns that relate to
the changes.
the changes.
3. Identification of potential issues in the code, as per criteria above.
4. Recommendations for rewrite and refactoring, if applicable.
+ Focus on critical issues, and then, on minimizing maintenance costs.
+ Search for refactoring opportunities: almost every PR will have them. Look for:
+ Code reuse: not only within a PR, but code already in the codebase that could
be reused or modified instead of re-written.
be reused or modified instead of re-written.
+ Data structures: enforce use of type hints and data structures consistently
(e.g. Pydantic classes in Python).
(e.g. Pydantic classes in Python).
+ Long methods and functions: recommend splitting them.
+ Scope reduction: prefer functions over methods.
+ Prefer composition over inheritance.
+ Simplification: complex functions, classes, or modules that could be
simplified.
simplified.
5. Additional comments, suggestions, and nit-picks that could help improve the code
quality and reliability.
quality and reliability.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
.DS_Store

.agents
seaweedfs
**/agents.md
47 changes: 0 additions & 47 deletions .markdownlint.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions .markdownlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sdk/docs/mkdocs/getting-started.md
sdk/docs/README.md
20 changes: 10 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
exclude: "^docs/|/migrations/|devcontainer.json"
default_stages: [ pre-commit ]
default_stages: [pre-commit]

default_language_version:
python: python3.13
Expand All @@ -19,7 +19,7 @@ repos:
- id: check-yaml
- id: debug-statements
- id: check-added-large-files
args: [ "--maxkb=1024" ]
args: ["--maxkb=1024"]
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
Expand Down Expand Up @@ -47,14 +47,14 @@ repos:
rev: v2.4.15
hooks:
- id: biome-check
additional_dependencies: [ "@biomejs/biome@^1.0.0" ]
additional_dependencies: ["@biomejs/biome@^1.9.4"]

# automatically upgrades Django code to migrates patterns and avoid deprecation warnings
- repo: https://github.com/adamchainz/django-upgrade
rev: "1.30.0"
hooks:
- id: django-upgrade
args: [ "--target-version", "4.2" ]
args: ["--target-version", "4.2"]

# runs the ruff linter and formatter
- repo: https://github.com/astral-sh/ruff-pre-commit
Expand All @@ -70,8 +70,8 @@ repos:
# could be applied to the gateway side.
[
# --verbose, # for debugging
# --show-files, # for debugging
# --show-fixes, # for debugging
# --show-files, # for debugging
# --show-fixes, # for debugging
--no-cache,
--fix,
--exit-non-zero-on-fix,
Expand All @@ -80,7 +80,7 @@ repos:
] # --show-settings, # for debugging
# formatter
- id: ruff-format # runs ruff format --force-exclude
args: [ --config, "sdk/pyproject.toml" ]
args: [--config, "sdk/pyproject.toml"]

# linter for django templates
- repo: https://github.com/Riverside-Healthcare/djLint
Expand All @@ -89,13 +89,13 @@ repos:
- id: djlint-reformat-django
- id: djlint-django

# linter for markdown files - see .markdownlint.yaml to configure rules
# linter for markdown files - see .rumdl.toml to configure rules
- repo: https://github.com/rvben/rumdl-pre-commit
rev: v0.2.0
hooks:
- id: rumdl # Lint only (fails on issues)
- id: rumdl-fmt # Auto-format and fail if issues remain
stages: [ pre-commit ]
stages: [pre-commit]

- repo: local
# add deptry rule exceptions to pyproject.toml [tool.deptry.ignore_rules]
Expand All @@ -106,7 +106,7 @@ repos:
entry: bash -c "cd sdk && uv run deptry .; cd ../gateway && uv run deptry ."
language: system
pass_filenames: false # run once per commit, not per file
types: [ python ]
types: [python]
- id: fallow-cross-file-dupes
name: fallow cross-file dupes (gateway static js)
entry: bash gateway/scripts/fallow-cross-file-dupes.sh
Expand Down
40 changes: 40 additions & 0 deletions .rumdl.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Based on:
# https://github.com/rvben/rumdl/blob/main/rumdl.toml.example

# Global configuration options
[global]
exclude = [
# e.g. exclude any obsidian-style files
"sdk/docs/mkdocs/api/client.md",
"sdk/docs/mkdocs/api/models.md",
]
include = ["**/*.md", "**/*.mdc", "**/*.gfm"]
# Globally disable specific rules based on .markdownlint.json
disable = [
"MD013", # line length
"MD024", # no duplicate heading
"MD025", # multiple top-level headings in the same document
"MD033", # no inline HTML
"MD077", # list continuation content indentation
]
respect-gitignore = true

[MD007]
# https://rumdl.dev/md007/
# Unordered list indentation
indent = 4
start-indented = false
# style = "fixed" # indentation style: "text-aligned" (default) | "fixed"

[MD073]
# https://rumdl.dev/md073/
# ToC validation
enabled = true # whether to validate the TOC (default: false)
enforce-order = true # whether TOC order must match document order (default: true)
max-level = 4 # max heading level to include (default: 6)
min-level = 2 # min heading level to include (default: 4)
# indent = 4 # spaces per indentation level (default: from MD007, or 2)

[MD046]
# https://rumdl.dev/md046
style = "fenced" # "consistent" | "fenced" | "indented"
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"python.analysis.enablePytestSupport": false
"python.analysis.enablePytestSupport": false
}
20 changes: 20 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"formatter": {
"indentStyle": "space",
"indentWidth": 4
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"complexity": {
"noStaticOnlyClass": "off"
}
}
},
"javascript": {
"formatter": {
"semicolons": "asNeeded"
}
}
}
14 changes: 7 additions & 7 deletions gateway/.fallowrc.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"$schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json",
"ignorePatterns": [
"sds_gateway/static/js/deprecated/**",
"compose/**",
"sds_gateway/static/css/**"
],
"ignoreExportsUsedInFile": true
"$schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json",
"ignorePatterns": [
"sds_gateway/static/js/deprecated/**",
"compose/**",
"sds_gateway/static/css/**"
],
"ignoreExportsUsedInFile": true
}
5 changes: 2 additions & 3 deletions gateway/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"markdownlint.configFile": "../.markdownlint.yaml",
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": false
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": false
}
33 changes: 21 additions & 12 deletions gateway/biome.jsonc
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
// https://biomejs.dev/reference/configuration/#_top
{
"formatter": {
// "useEditorconfig": true, // Use the .editorconfig file in the project
// enable this when the vscode ext is updated, remove the settings below.
// https://github.com/biomejs/biome-vscode/releases
"indentStyle": "space",
"indentWidth": 4
},
"javascript": {
"formatter": {
"semicolons": "asNeeded"
}
}
"formatter": {
// "useEditorconfig": true, // Use the .editorconfig file in the project
// enable this when the vscode ext is updated, remove the settings below.
// https://github.com/biomejs/biome-vscode/releases
"indentStyle": "space",
"indentWidth": 4
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"complexity": {
"noStaticOnlyClass": "off"
}
}
},
"javascript": {
"formatter": {
"semicolons": "asNeeded"
}
}
}
2 changes: 1 addition & 1 deletion gateway/compose.local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ networks:
sds-gateway-local-opensearch-net:
driver: bridge
sds-network-local:
# external: true # make it external if running with traefik on this machine
external: true # make it external if running with traefik on this machine
# should match traefik's network name
name: sds-network-local
driver: bridge
Expand Down
8 changes: 4 additions & 4 deletions gateway/docs/detailed-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ production hosts.

+ `roles.yml`: Here, you can set up custom roles for users. The extensive list of
allowed permissions can be found
[here](https://opensearch.org/docs/latest/security/access-control/permissions/).
[OpenSearch access control permissions documentation](https://opensearch.org/docs/latest/security/access-control/permissions/).

+ `roles_mapping.yml`: In this file, you can map roles to users defined in
`internal_users.yml`. It is necessary to map a role directly to a user by adding
Expand Down Expand Up @@ -616,7 +616,7 @@ Here are some useful examples of advanced queries one might want to make to the
> `now` is a keyword in OpenSearch that refers to the current date and time.

More information about `range` queries can be found
[here](https://opensearch.org/docs/latest/query-dsl/term/range/).
[OpenSearch range queries documentation](https://opensearch.org/docs/latest/query-dsl/term/range/).

2. Geo-bounding Box Queries

Expand Down Expand Up @@ -647,7 +647,7 @@ Here are some useful examples of advanced queries one might want to make to the
```

More information about `geo_bounding_box` queries can be found
[here](https://opensearch.org/docs/latest/query-dsl/geo-and-xy/geo-bounding-box/).
[OpenSearch geo-bounding box queries documentation](https://opensearch.org/docs/latest/query-dsl/geo-and-xy/geo-bounding-box/).

3. Geodistance Queries

Expand All @@ -672,4 +672,4 @@ Here are some useful examples of advanced queries one might want to make to the
```

More information about `geo_distance` queries can be found
[here](https://opensearch.org/docs/latest/query-dsl/geo-and-xy/geodistance/).
[OpenSearch geodistance queries documentation](https://opensearch.org/docs/latest/query-dsl/geo-and-xy/geodistance/).
Loading
Loading