Details
- Reviewers
olasd - Group Reviewers
Reviewers - Commits
- rDMODd1b215694a35: Add a model based using 'attrs' and Hypothesis strategies to generate it.
Diff Detail
- Repository
- rDMOD Data model
- Branch
- attrs-model
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 5184 Build 6991: tox-on-jenkins Jenkins Build 6990: arc lint + arc unit
Event Timeline
Build is green
See https://jenkins.softwareheritage.org/job/DMOD/job/tox/46/ for more details.
Build is green
See https://jenkins.softwareheritage.org/job/DMOD/job/tox/48/ for more details.
Build is green
See https://jenkins.softwareheritage.org/job/DMOD/job/tox/49/ for more details.
Thanks for putting this together!
The model.py file is missing a model for snapshots. Apart from that, the changes requested are really marginal.
I think we could also remove the validators/fields module as they're not used at all.
The test for the hypothesis strategy is also quite minimalistic ;)
swh/model/model.py | ||
---|---|---|
12 | 20 bytes ;) | |
42 | DateWithTimezone? TimestampWithTimezone? It's not really just a date. (I know the revision/release fields are poorly named) | |
81–82 | Both of these fields are nullable | |
84 | This should probably be (validated as) an Enum of some sort. | |
104 | Metadata is a nullable dict. | |
116 | In the future, we should add a validator to prevent b'/' and b'\x00' | |
121 | Technically, valid permissions should all be > 512 In arbitrary loaders, we normalize this way (swh.model.from_disk.DentryPerms) :
And during its early history git has also accepted files with arbitrary integer perms (so anything between 0o000000 and 0o107777), which we've ended up loading to keep the proper directory ids. [tangent ahead] There's also the case of the rugged (ruby git library used by... GitHub) bug that would zero-pad permissions on trees (so serializing them as 040000 instead of 40000), which means some directories actually have two valid ids. It's great. [/tangent] Anyway, doesn't sound like it's /that/ easy to validate directory entry perms :P. |
swh/model/model.py | ||
---|---|---|
42 | ardumont suggested I rename it to GitDate |
swh/model/model.py | ||
---|---|---|
42 | It's really not a git date, git only supports second granularity. |
swh/model/model.py | ||
---|---|---|
42 | Ok. What about TzTimestamp? |
swh/model/model.py | ||
---|---|---|
42 | I'd prefer the acronym to be expanded, but apart from that, really, *shrug* |
Build is green
See https://jenkins.softwareheritage.org/job/DMOD/job/tox/50/ for more details.
Build is green
See https://jenkins.softwareheritage.org/job/DMOD/job/tox/51/ for more details.
Build is green
See https://jenkins.softwareheritage.org/job/DMOD/job/tox/52/ for more details.
Build is green
See https://jenkins.softwareheritage.org/job/DMOD/job/tox/53/ for more details.
Build is green
See https://jenkins.softwareheritage.org/job/DMOD/job/tox/54/ for more details.
- rebase
- fix size of sha1_git on my version of hypothesis
- fix target_type in branch_targets_object
Build is green
See https://jenkins.softwareheritage.org/job/DMOD/job/tox/55/ for more details.