Skip to content

Conversation

@wvandeun
Copy link
Contributor

@wvandeun wvandeun commented Jan 6, 2026

Summary by CodeRabbit

  • Documentation
    • Added a comprehensive File Object design spec covering a user-extensible core file type with standard metadata (name, checksum, size, type, storage id), attachment relationships and cardinalities, versioning and branch semantics, permission integration, configurable max file size, REST and GraphQL upload/download/query surfaces, Python SDK workflows, frontend rendering/permission considerations, and open UI/integration questions and future considerations.

✏️ Tip: You can customize this high-level summary in your review settings.

@wvandeun wvandeun self-assigned this Jan 6, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 6, 2026

Caution

Review failed

The pull request is closed.

Walkthrough

Adds a design/spec for a File Object feature centered on a CoreFileObject generic base with core read-only attributes: file_name, checksum, file_size, file_type, and storage_id. Defines how user-defined file object types inherit and extend CoreFileObject, with YAML schema examples and sample types (CircuitContract, CircuitMaintenance). Specifies file and storage versioning semantics, permission integration, configurable max file size (TOML example), GraphQL queries/mutations, REST upload/download endpoints, Python SDK workflows, frontend scope, and open issues.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'File object feature spec' directly and accurately summarizes the main change—a comprehensive design/specification document for a File Object feature.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c192e7e and c209228.

📒 Files selected for processing (1)
  • dev/specs/2026-01-file-object.md

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.

@wvandeun wvandeun force-pushed the wvd-20260105-file-attachment-spec branch from d28333f to 505e748 Compare January 6, 2026 10:59
@wvandeun wvandeun changed the title Object file attachment feature spec File object feature spec Jan 6, 2026
@gmazoyer gmazoyer force-pushed the wvd-20260105-file-attachment-spec branch from bec05b1 to bf570f3 Compare January 7, 2026 13:02
@gmazoyer gmazoyer changed the base branch from stable to develop January 7, 2026 13:02
@gmazoyer
Copy link
Contributor

gmazoyer commented Jan 7, 2026

Branch rebased and target changed to develop

@gmazoyer gmazoyer marked this pull request as ready for review January 7, 2026 14:20
Copy link
Contributor

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

🤖 Fix all issues with AI agents
In @dev/specs/2026-01-file-object.md:
- Line 482: Fix the spelling mistake in the markdown heading "#### Adding a new
FileOjbect" by renaming "FileOjbect" to "FileObject" so the heading reads "####
Adding a new FileObject"; update any other occurrences of the misspelled symbol
"FileOjbect" in this document to "FileObject" to keep naming consistent.
- Line 209: Change the pronoun used for a person reference on the sentence about
permissions so it reads "who" instead of "that"; locate the sentence discussing
a user and permissions for FileObject and the storage API (mentions `FileObject`
and "storage API") and replace "that has no permission to view a `FileObject`
object" with "who has no permission to view a `FileObject` object".
- Line 58: Change the heading "User defined file object type" to use the
compound adjective form "User-defined file object type" so the adjective
correctly modifies the noun; update the text fragment "User defined" to
"User-defined" wherever it appears as a pre-nominal adjective (e.g., the heading
line "User defined file object type") to fix hyphenation.
- Line 215: Update the compound adjectives in the sentence: change "small file
objects" to "small-file objects" and change "multi GB size" to "multi-GB" (so
the phrase becomes e.g. "no multi-GB size of files"). Ensure both instances of
the original phrases are replaced and preserve the surrounding examples
("config, word type documents, images" and "device firmware").
- Line 259: The GraphQL query example uses the wrong field name `file_checksum`;
update the example to match the CoreFileObject schema by replacing
`file_checksum` with `checksum` so the query references the actual attribute
defined on CoreFileObject (refer to CoreFileObject and its `checksum` field).
- Line 55: Replace the typo "meme-type" with the correct term "mime-type" in the
file_type attribute description (the `file_type` field) and any other
occurrences in this spec section so the text reads "...derived from the uploaded
file's file extension, or derived from the mime-type."
🧹 Nitpick comments (2)
dev/specs/2026-01-file-object.md (2)

121-121: Reduce repetitive phrasing.

The phrase "if you want to" appears twice in nearby sentences (lines 121–122). Consider rephrasing for variety.


203-203: Use "will" for certainty and fix hyphenation.

Line 203: Replace "going to be" with "will be" for more formal documentation tone, and add hyphen to "object-level".

Suggested revision
-A known issue will occur when there is a merge conflict. For example, a branch was created after which a file object is updated in the main branch and the newly created branch. When opening a proposed change the user will be asked to resolve a conflict. Today conflict resolution works at the attribute or relationship level, not at the object level. This means it is possible for the user to pick the checksum of the main branch and the storage_id of the other branch, invalidating the file object. For the first implementation this is going to be a documented limitation, but we should look at object level conflict resolution (new card to be created)
+A known issue will occur when there is a merge conflict. For example, a branch was created after which a file object is updated in the main branch and the newly created branch. When opening a proposed change the user will be asked to resolve a conflict. Today conflict resolution works at the attribute or relationship level, not at the object level. This means it is possible for the user to pick the checksum of the main branch and the storage_id of the other branch, invalidating the file object. For the first implementation this will be a documented limitation, but we should look at object-level conflict resolution (new card to be created)
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9a19500 and bf570f3.

📒 Files selected for processing (1)
  • dev/specs/2026-01-file-object.md
🧰 Additional context used
📓 Path-based instructions (1)
**/*.md

📄 CodeRabbit inference engine (AGENTS.md)

Follow Markdown coding standards defined in dev/guidelines/markdown.md

Files:

  • dev/specs/2026-01-file-object.md
🧠 Learnings (2)
📚 Learning: 2026-01-03T10:50:53.618Z
Learnt from: CR
Repo: opsmill/infrahub PR: 0
File: backend/AGENTS.md:0-0
Timestamp: 2026-01-03T10:50:53.618Z
Learning: New GraphQL mutations and queries require approval

Applied to files:

  • dev/specs/2026-01-file-object.md
📚 Learning: 2026-01-03T10:50:53.618Z
Learnt from: CR
Repo: opsmill/infrahub PR: 0
File: backend/AGENTS.md:0-0
Timestamp: 2026-01-03T10:50:53.618Z
Learning: Applies to backend/infrahub/**/*.py : Use async/await for all I/O operations

Applied to files:

  • dev/specs/2026-01-file-object.md
🪛 LanguageTool
dev/specs/2026-01-file-object.md

[grammar] ~58-~58: Use a hyphen to join words.
Context: ...ed file in Infrahub’s storage #### User defined file object type A user will ha...

(QB_NEW_EN_HYPHEN)


[style] ~121-~121: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...e cardinality one relationships, if you want to create a file attachment of which you w...

(REP_WANT_TO_VB)


[style] ~203-~203: Use ‘will’ instead of ‘going to’ if the following action is certain.
Context: ...ject. For the first implementation this is going to be a documented limitation, but we shou...

(GOING_TO_WILL)


[grammar] ~203-~203: Use a hyphen to join words.
Context: ...limitation, but we should look at object level conflict resolution (new card to b...

(QB_NEW_EN_HYPHEN)


[style] ~209-~209: Consider using “who” when you are referring to a person instead of an object.
Context: ...so on the storage object itself. A user that has no permission to view a `FileObject...

(THAT_WHO)


[grammar] ~215-~215: Use a hyphen to join words.
Context: ...o add "small" file objects (config, word type documents, images), IE no multi GB ...

(QB_NEW_EN_HYPHEN)


[grammar] ~482-~482: Ensure spelling is correct
Context: ...sing the Python SDK. #### Adding a new FileOjbect This method, would allow the user to upl...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (1)
dev/specs/2026-01-file-object.md (1)

500-596: The file object specification correctly uses InfrahubClientSync with synchronous file operations. The async/await requirement from the backend guidelines applies only to backend implementation code (backend/infrahub/**/*.py), not to specification documentation. No async SDK client variant exists in the codebase; the SDK is designed as synchronous. The examples are consistent with the actual SDK design and require no changes.

Likely an incorrect or invalid review comment.

Copy link
Contributor

@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

🤖 Fix all issues with AI agents
In @dev/specs/2026-01-file-object.md:
- Line 251: The GraphQL query uses an incorrect field name file_checksum while
the CoreFileObject schema defines the attribute as checksum; update the query
(and any other instances) to use checksum to match the CoreFileObject type
definition and ensure the query resolves at runtime, referencing the
CoreFileObject schema and replacing file_checksum with checksum wherever
present.
- Around line 487-503: The example call to client.create for
NetworkCircuitContract uses the incorrect keyword storaged_id; rename this
argument to storage_id to match the CoreFileObject schema attribute (storage_id)
and avoid runtime errors when creating the contract via client.create (refer to
CoreFileObject and NetworkCircuitContract in the snippet). Ensure any other
examples or tests use storage_id consistently.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bf570f3 and 6833e29.

📒 Files selected for processing (1)
  • dev/specs/2026-01-file-object.md
🧰 Additional context used
📓 Path-based instructions (1)
**/*.md

📄 CodeRabbit inference engine (AGENTS.md)

Follow Markdown coding standards defined in dev/guidelines/markdown.md

Files:

  • dev/specs/2026-01-file-object.md
🧠 Learnings (2)
📚 Learning: 2026-01-03T10:50:53.618Z
Learnt from: CR
Repo: opsmill/infrahub PR: 0
File: backend/AGENTS.md:0-0
Timestamp: 2026-01-03T10:50:53.618Z
Learning: New GraphQL mutations and queries require approval

Applied to files:

  • dev/specs/2026-01-file-object.md
📚 Learning: 2026-01-03T10:50:53.618Z
Learnt from: CR
Repo: opsmill/infrahub PR: 0
File: backend/AGENTS.md:0-0
Timestamp: 2026-01-03T10:50:53.618Z
Learning: Applies to backend/infrahub/**/*.py : Use async/await for all I/O operations

Applied to files:

  • dev/specs/2026-01-file-object.md
🪛 LanguageTool
dev/specs/2026-01-file-object.md

[grammar] ~58-~58: Use a hyphen to join words.
Context: ...ed file in Infrahub’s storage #### User defined file object type A user will ha...

(QB_NEW_EN_HYPHEN)


[style] ~121-~121: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...e cardinality one relationships, if you want to create a file attachment of which you w...

(REP_WANT_TO_VB)


[style] ~205-~205: Consider using “who” when you are referring to a person instead of an object.
Context: ...so on the storage object itself. A user that has no permission to view a `FileObject...

(THAT_WHO)


[grammar] ~211-~211: Use a hyphen to join words.
Context: ...o add "small" file objects (config, word type documents, images), IE no multi GB ...

(QB_NEW_EN_HYPHEN)


[grammar] ~474-~474: Ensure spelling is correct
Context: ...sing the Python SDK. #### Adding a new FileOjbect This method, would allow the user to upl...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[style] ~592-~592: Use ‘will’ instead of ‘going to’ if the following action is certain.
Context: ...ject. For the first implementation this is going to be a documented limitation, but we shou...

(GOING_TO_WILL)


[grammar] ~592-~592: Use a hyphen to join words.
Context: ...limitation, but we should look at object level conflict resolution (new card to b...

(QB_NEW_EN_HYPHEN)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: documentation
🔇 Additional comments (1)
dev/specs/2026-01-file-object.md (1)

223-435: GraphQL API design requires approval before implementation.

Per the learnings, new GraphQL mutations and queries require approval. This section introduces multiple new queries and mutations. Note that a past review comment from ogenstad suggested an alternative mutation design with a dedicated file parameter option—consider whether that feedback has been incorporated or should be addressed.

Copy link
Contributor

@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

🤖 Fix all issues with AI agents
In @dev/specs/2026-01-file-object.md:
- Around line 55-58: Replace the typo "meme-type" with "mime-type" in the
description for `file_type`; change the heading "User defined file object type"
to "User-defined file object type"; in the prose where it reads "A user that"
change to "A user who"; correct "word type documents" to "word-type documents",
"IE" to "i.e.", and "multi GB" to "multi-GB"; fix the heading "FileOjbect" to
"FileObject"; and hyphenate "object level" to "object-level" and replace "going
to be" with "will be" where applicable — search for these exact phrases in the
spec and apply the replacements.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6833e29 and c192e7e.

📒 Files selected for processing (1)
  • dev/specs/2026-01-file-object.md
🧰 Additional context used
📓 Path-based instructions (1)
**/*.md

📄 CodeRabbit inference engine (AGENTS.md)

Follow Markdown coding standards defined in dev/guidelines/markdown.md

Files:

  • dev/specs/2026-01-file-object.md
🧠 Learnings (2)
📚 Learning: 2026-01-03T10:50:53.618Z
Learnt from: CR
Repo: opsmill/infrahub PR: 0
File: backend/AGENTS.md:0-0
Timestamp: 2026-01-03T10:50:53.618Z
Learning: New GraphQL mutations and queries require approval

Applied to files:

  • dev/specs/2026-01-file-object.md
📚 Learning: 2026-01-03T10:50:53.618Z
Learnt from: CR
Repo: opsmill/infrahub PR: 0
File: backend/AGENTS.md:0-0
Timestamp: 2026-01-03T10:50:53.618Z
Learning: Applies to backend/infrahub/**/*.py : Use async/await for all I/O operations

Applied to files:

  • dev/specs/2026-01-file-object.md
🪛 LanguageTool
dev/specs/2026-01-file-object.md

[grammar] ~58-~58: Use a hyphen to join words.
Context: ...ed file in Infrahub’s storage #### User defined file object type A user will ha...

(QB_NEW_EN_HYPHEN)


[style] ~121-~121: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...e cardinality one relationships, if you want to create a file attachment of which you w...

(REP_WANT_TO_VB)


[style] ~205-~205: Consider using “who” when you are referring to a person instead of an object.
Context: ...so on the storage object itself. A user that has no permission to view a `FileObject...

(THAT_WHO)


[grammar] ~211-~211: Use a hyphen to join words.
Context: ...o add "small" file objects (config, word type documents, images), IE no multi GB ...

(QB_NEW_EN_HYPHEN)


[grammar] ~474-~474: Ensure spelling is correct
Context: ...sing the Python SDK. #### Adding a new FileOjbect This method, would allow the user to upl...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[style] ~592-~592: Use ‘will’ instead of ‘going to’ if the following action is certain.
Context: ...ject. For the first implementation this is going to be a documented limitation, but we shou...

(GOING_TO_WILL)


[grammar] ~592-~592: Use a hyphen to join words.
Context: ...limitation, but we should look at object level conflict resolution (new card to b...

(QB_NEW_EN_HYPHEN)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: documentation
  • GitHub Check: Cloudflare Pages

@wvandeun wvandeun merged commit 2fc789b into develop Jan 7, 2026
8 of 10 checks passed
@wvandeun wvandeun deleted the wvd-20260105-file-attachment-spec branch January 7, 2026 16:11
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.

4 participants