Repository navigation
An import's counts, file name and invalid rows' reasons, and its deletions are counted - #1133
Open
paynejd wants to merge 1 commit into
Conversation
…ort's counts, file name and invalid rows' reasons, and its deletions are counted - A parallel import's summary adds up its parts' counts (created, updated, deleted, invalid, failed and the others), as it runs. A package import's summary has them too. - Each invalid row in the report has `errors`, with the required fields it lacks. A row of an unknown type is invalid too, and no longer dropped. The one-line summaries count invalid and failed rows, and a parallel import's report has `not_found`. - A task has `file_name`: the uploaded file's name, the last part of its URL's path, or a package's name and version. - The version that an import's deletion saves has `_counted=None`, as created and updated ones do, so the count job recounts its source. Only what the row retired counts as deleted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qTEw8c6qZh5C69F1V4
Member
Author
|
Reviews of this branch Codex (codex-cli 0.171.0) made three passes and two short checks of the fixes after them, and a fresh Claude subagent looked for what could be cut and found nothing. The findings, with an answer to each, are on OpenConceptLab/ocl_online#399.
|
snyaggarwal
approved these changes
Dec 4, 2026
snyaggarwal
left a comment
Contributor
There was a problem hiding this comment.
Reviewed 46cc46f against its base, #1117's head 8ff1a6e. Approving.
- Open-core: the new counts are results the import already produced: rows created, updated, deleted, invalid, failed and so on. They record what happened and limit nothing. No allowance, limit or plan wording is added anywhere, including tests and the migration.
- Parallel counts:
get_result_counts()adds up its parts' summaries in one read. It treats a part that hasn't started, or an older summary with missing keys, as 0, and it adds the seeding version line's result.test_notify_progresscovers all three. The processed total is read separately, so a running import's numbers can be one update apart; the accepted F3.3 says so, and the final numbers are right. - Existing clients: every change to
summaryadds keys. A parallel import's summary still hasprocessedandtotal, and a package import's detail adds keys besidetotal,processed,failedanddependencies.file_nameis a new nullable field in the list. An invalid row in the report gains anerrorskey. The inline one-line summary now has| Invalid: Nbefore| Failed:. I found no client that parses that line: oclweb2, oclweb3 and ocldev don't. - Deletions:
- Under
master, a deletion's version was saved with_counted=True, which the count job skips. So a source's count stayed stale after an import deleted something. counted=Nonehands it to the count job. The defaultTruekeeps every other caller ofretire()as before, sinceclone()left the model default anyway.- An already-retired row is now
unchanged, and a failed retire is nowfailedinstead ofdeleted.test_only_what_a_deletion_retires_is_deletedandtest_an_imports_deletions_are_countedcover both.
- Under
- Invalid rows: every importer
get_invalid_line_errors()uses is a direct subclass ofBaseResourceImporter, so__subclasses__()finds them all. An unknown type is reported only after every known type has hit itscontinue, so no row counts twice. In a package,Falsenow fails with its reason. Before, it went through theintbranch as0. - File names: the scheme, userinfo and host are dropped, and so are the query and fragment. Only the last part of the path is kept, or a package's name and version. The tests include URLs with a token and with userinfo. FC.2 (a share link shaped like a registry path) is reasonable to accept: only the person who ran the import, and staff, see the name.
- Migration:
tasks/0015is the only newtasksmigration in any open PR. It adds a nullable column, so it's safe to run while the old version serves.
Stacking: the base is #1117's branch at its approved head. Once #1117 merges, this PR needs master as its base. GitHub retargets it if #1117's branch is deleted; otherwise change the base by hand before merging.
CI on 46cc46f: Pylint and Tests pass.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs OpenConceptLab/ocl_online#399 and OpenConceptLab/ocl_online#749. Built on #1117, which merges first.
What the API does now
summaryhascreated,updated,deleted,invalid,failed,exists,not_found,permission_deniedandunchangedbesidetotalandprocessed, while it runs and after. A parallel import adds up its parts' counts, which it didn't before. A package import's summary has them too, exceptinvalidandnot_found: an invalid row of a package counts as failed.errors, with the required fields it lacks, such as{"concept_class": ["This field is required."]}. A row of an unknown type is invalid too; it was dropped without a word. The one-line summary counts invalid and failed rows.file_name: the uploaded file's name, or the last part of its URL's path (for a package, its name and version). It's null for pasted text and for older imports.unchanged, and an error fails the row.Migration:
tasks/0015adds the nullable columnfile_nametocelery_tasks.Order: #1117, then #1130 and this one in either order. I merged this branch with #1130 and ran the whole suite on the result: no conflicts, and all tests pass. The page that shows these fields is a separate pull request in oclweb3 and works with or without them.
Tests: 4,306 pass, and pylint is clean. I also ran real imports through Celery workers: a file with one bad row, one with deletions and one with every kind of result.
🤖 Generated with Claude Code
https://claude.ai/code/session_01AaZ4qTEw8c6qZh5C69F1V4