converters: fixed a bug where /revision/<sha1_git> would raise an exception
api view: added /api/1/revision/<sha1_git>/raw/ route
test_api: update to reflect the addition of /api/1/revision/<sha1_git>/raw to api routes.
Details
- Reviewers
ardumont - Group Reviewers
Reviewers - Maniphest Tasks
- T298: Add /api/1/revision/<sha1_git>/raw/
- Commits
- R65:1add258a7f99: api: use raw backend lookup instead of service wrapper for raw rev msg
R65:cd6906154b9e: tests: update api and service tests to reflect changes
R65:6f45b82fd3e6: Service: more idiomatic dictionary removal
R65:7a0cfff3f9a2: api tests: test exception message reflects the error it should report
R65:a5b1e3fe9f63: service and api tests: fix raw revision message tests
R65:4f22178ad32c: api view: added /api/1/revision/<sha1_git>/raw/ route
R65:ca51fbaab71a: test_api: update to reflect the addition of /api/1/revision/<sha1_git>/raw to…
R65:96bfc8db9daf: api: update lookup_revision to reflect service changes, add raw message lookup
R65:9c7cd094c321: service: * add function to get _only_ raw revision message * restrict…
R65:476cf9275bc2: Converters: fixed a bug where the revision author's full name was not decoded…
rDWAPPS9c7cd094c321: service: * add function to get _only_ raw revision message * restrict…
rDWAPPS96bfc8db9daf: api: update lookup_revision to reflect service changes, add raw message lookup
rDWAPPS7a0cfff3f9a2: api tests: test exception message reflects the error it should report
rDWAPPSa5b1e3fe9f63: service and api tests: fix raw revision message tests
rDWAPPScd6906154b9e: tests: update api and service tests to reflect changes
rDWAPPSca51fbaab71a: test_api: update to reflect the addition of /api/1/revision/<sha1_git>/raw to…
rDWAPPS1add258a7f99: api: use raw backend lookup instead of service wrapper for raw rev msg
rDWAPPS6f45b82fd3e6: Service: more idiomatic dictionary removal
rDWAPPS4f22178ad32c: api view: added /api/1/revision/<sha1_git>/raw/ route
rDWAPPS476cf9275bc2: Converters: fixed a bug where the revision author's full name was not decoded…
Diff Detail
- Repository
- rDWAPPS Web applications
- Branch
- T298
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 139 Build 202: Software Heritage Python tests Build 201: arc lint + arc unit
Event Timeline
swh/web/ui/converters.py | ||
---|---|---|
167 | Yes, indeed. | |
swh/web/ui/views/api.py | ||
515 | I think the point was to make the actual api_revision returns the full revision except for its message. And this new api should only return the revision message. And in the views, the browse revision should:
All of this for avoiding trouble when revision message are not utf-8 encoded. |
swh/web/ui/views/api.py | ||
---|---|---|
515 | Gotcha. I'll update the revision and revision/raw tests to reflect that as well, the stubs included messages, hence my confusion. |
swh/web/ui/views/api.py | ||
---|---|---|
515 |
Well, the description does not say anything about this, so it's not like you could have foreseen it |
Split revision/raw message lookups
- service: add raw message only lookup
- api: update lookup_revision to reflect service changes, add raw
- tests: update api and service tests to reflect changes
swh/web/ui/tests/views/test_api.py | ||
---|---|---|
743 | As we said earlier, it should be None here instead. | |
752 | ...And you'll get a 404 here. | |
swh/web/ui/views/api.py | ||
519 | As we exchange, you can simply call service.lookup_revision_message since it does the job already. |
Minor corrections
- Service: more idiomatic dictionary removal
- api: use raw backend lookup instead of service wrapper for raw rev msg
- service and api tests: fix raw revision message tests
swh/web/ui/tests/views/test_api.py | ||
---|---|---|
768 | Nitpick, it's the 'no revision was found' use case. |
swh/web/ui/tests/views/test_api.py | ||
---|---|---|
768 | You'd think that was a misplaced copy-paste, but it was hand-written the same in both tests --' |
Fix error message
- api tests: test exception message reflects the error it should report
swh/web/ui/tests/views/test_api.py | ||
---|---|---|
768 | oops ^^ |