Skip to content

Commit

Permalink
Addons: rename fields on API response (#11764)
Browse files Browse the repository at this point in the history
Instead of using `version_a` and `version_b`, we are using `current` and
`base` for these field names. These names are standard GitHub/Git names,
for example when creating pull requests and you have to select the "base
branch".

* Refs:
#11762 (comment)
* Refs:
#11749 (comment)
  • Loading branch information
humitos authored Nov 18, 2024
1 parent fd655f1 commit 2c1e861
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions readthedocs/proxito/tests/test_hosting.py
Original file line number Diff line number Diff line change
Expand Up @@ -984,26 +984,26 @@ def test_file_tree_diff(self, get_manifest):
{
"filename": "new-file.html",
"urls": {
"version_a": "https://project--123.dev.readthedocs.build/en/123/new-file.html",
"version_b": "https://project.dev.readthedocs.io/en/latest/new-file.html",
"current": "https://project--123.dev.readthedocs.build/en/123/new-file.html",
"base": "https://project.dev.readthedocs.io/en/latest/new-file.html",
},
},
],
"deleted": [
{
"filename": "deleted.html",
"urls": {
"version_a": "https://project--123.dev.readthedocs.build/en/123/deleted.html",
"version_b": "https://project.dev.readthedocs.io/en/latest/deleted.html",
"current": "https://project--123.dev.readthedocs.build/en/123/deleted.html",
"base": "https://project.dev.readthedocs.io/en/latest/deleted.html",
},
},
],
"modified": [
{
"filename": "tutorial/index.html",
"urls": {
"version_a": "https://project--123.dev.readthedocs.build/en/123/tutorial/index.html",
"version_b": "https://project.dev.readthedocs.io/en/latest/tutorial/index.html",
"current": "https://project--123.dev.readthedocs.build/en/123/tutorial/index.html",
"base": "https://project.dev.readthedocs.io/en/latest/tutorial/index.html",
},
},
],
Expand Down
12 changes: 6 additions & 6 deletions readthedocs/proxito/views/hosting.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,12 +657,12 @@ def _get_filetreediff_response(self, *, request, project, version, resolver):
{
"filename": filename,
"urls": {
"version_a": resolver.resolve_version(
"current": resolver.resolve_version(
project=project,
filename=filename,
version=version,
),
"version_b": resolver.resolve_version(
"base": resolver.resolve_version(
project=project,
filename=filename,
version=latest_version,
Expand All @@ -675,12 +675,12 @@ def _get_filetreediff_response(self, *, request, project, version, resolver):
{
"filename": filename,
"urls": {
"version_a": resolver.resolve_version(
"current": resolver.resolve_version(
project=project,
filename=filename,
version=version,
),
"version_b": resolver.resolve_version(
"base": resolver.resolve_version(
project=project,
filename=filename,
version=latest_version,
Expand All @@ -693,12 +693,12 @@ def _get_filetreediff_response(self, *, request, project, version, resolver):
{
"filename": filename,
"urls": {
"version_a": resolver.resolve_version(
"current": resolver.resolve_version(
project=project,
filename=filename,
version=version,
),
"version_b": resolver.resolve_version(
"base": resolver.resolve_version(
project=project,
filename=filename,
version=latest_version,
Expand Down

0 comments on commit 2c1e861

Please sign in to comment.