-
Notifications
You must be signed in to change notification settings - Fork 43
File object feature spec #8041
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File object feature spec #8041
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughAdds 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)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
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. Comment |
d28333f to
505e748
Compare
bec05b1 to
bf570f3
Compare
|
Branch rebased and target changed to |
There was a problem hiding this 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
📒 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 usesInfrahubClientSyncwith 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.
There was a problem hiding this 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
📒 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
fileparameter option—consider whether that feedback has been incorporated or should be addressed.
There was a problem hiding this 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
📒 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
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.