[Bug] Evidence tables store commit SHAs in 40-character columns while SHA-256 commits are accepted
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Start with packages/core/src/repowise/core/persistence/models.py and the referenced SHA validation and evidence writing paths; inspect the existing Alembic migrations and persistence tests in tests/unit/persistence/. Verify which 40-character SHA columns evidence writes, then check the migration and ingest tests for 64-character values. Done means the relevant columns are 64 characters after upgrade and a 64-character commit round-trips; an open linked pull request indicates work is already underway.
Written by the indexing model from the issue text.
Description
Summary
The v1 parser accepts 64-character SHA-256 commit ids, but three evidence columns are String(40). On Postgres, ingesting a run from a SHA-256 repository fails at insert.
packages/core/src/repowise/core/persistence/models.py:3110
commit_sha: Mapped[str | None] = mapped_column(String(40), nullable=True)
Mechanism
format_v1._commit_sha(evidence/format_v1.py:195-205) checksis_full_sha, which accepts 40 or 64 hex characters (git_sha.py:33).evidence_runs.commit_sha(models.py:3110),evidence_test_stats.last_commit_sha(:3295) andsymbol_hotness.evidence_commit_sha(:3355) are 40 wide.- SQLite ignores the length, so local runs pass. Postgres raises a string-truncation error.
Repro
parse_evidence accepts commit_sha of length 64
evidence_runs.commit_sha VARCHAR(40)
evidence_test_stats.last_commit_sha VARCHAR(40)
symbol_hotness.evidence_commit_sha VARCHAR(40)
The Postgres insert failure is read from the schema, not run.
Done looks like
- Widen the three columns to
String(64)inmodels.pyand add one alembic migration (batch mode for SQLite), on the current head. - Grep the other
String(40)SHA columns that evidence writes and widen only those it fills. - Must not change: the validator.
- Not a first issue: it needs a migration.
Tests
A migration test in tests/unit/persistence/ that the columns are 64 wide after upgrade. An ingest test with a 64-character commit round-trips it.
- Dominant language
- Python
- Stars
- 7.1k
- Forks
- 756
- Avg merge
- 21h 5m
- Merged PRs (30d)
- 797
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from repowise-dev/repowise
-
[Bug] Elixir `.formatter.exs`, `.credo.exs`, `config/*.exs` and `priv/**/*.exs` are reported as unreachable filesPossibly taken @ZYZ666-RGB claimed this 1 day ago. Openbug good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
repowise-dev/repowise#6296 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug] Coverage stack detection omits Swift, Dart, and Scala, falling through to UNKNOWN in evidence setupPossibly taken @RishabhIIITD claimed this 2 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
repowise-dev/repowise#5838 · 2 comments ·
Maintainers usually reply within 1 day
-
[Bug] PR-mined decisions store the decision sentence again as their rationalePossibly taken @suyashgitt claimed this 11 days ago. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
repowise-dev/repowise#5702 · 2 comments ·
Maintainers usually reply within 1 day
-
[Bug] CICS CSD `DEFINE _PGMLIST` startup programs (`_PGMPH`) are not rootsPossibly taken @dchaudhari7177 claimed this 34 days ago. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
repowise-dev/repowise#4477 ·
Maintainers usually reply within 1 day
-
[Bug] COBOL listing directives EJECT, SKIP1/SKIP2/SKIP3 and TITLE fail to parse and drop the rest of the filePossibly taken @dchaudhari7177 claimed this 34 days ago. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
repowise-dev/repowise#4474 ·
Maintainers usually reply within 1 day
All issues in repowise-dev/repowise
Similar issues
-
triage
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
kornia/kornia-rs#1416 · 1 comment ·
Maintainers usually reply within 2 days
-
ui
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
PolicyEngine/ai-inequality#64 ·
Maintainers usually reply within 1 day
-
LinearGaussianStateSpace.dist splits states and observations wrongly when the transition varies over timePossibly taken @PabloRoque claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
pymc-devs/pymc-extras#839 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day