Skip to content

Commit ab7c3bf

Browse files
authored
update views ref (#9)
Update documentation to reflect changes in views repo nvaccess/docker-addonstore#36
1 parent e16c56e commit ab7c3bf

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Available endpoints:
4242
* Requires valid branch reference in payload
4343
* Requires auth token
4444
* Protected by distributed locking
45-
* Example payload: `{"ref": "refs/heads/views"}`
45+
* Example payload: `{"ref": "refs/heads/main"}`
4646

4747
* `GET /cacheHash.json`
4848
* Returns current git hash of the data store
@@ -58,7 +58,7 @@ Available endpoints:
5858
* `npm install -g markdownlint-cli2`
5959
* A virtual environment
6060
* Install requirements.txt inside the virtual environment
61-
* The `addon-datastore` repository checked out locally to a views branch.
61+
* The `addonstore-views` repository checked out locally.
6262

6363
### Testing Local Changes
6464

@@ -80,7 +80,7 @@ From the virtual environment
8080

8181
```sh
8282
FLASK_APP=app PYTHONPATH=./src TEMP=/tmp/ \
83-
dataViewsFolder=../../addon-datastore branchRef=views \
83+
dataViewsFolder=../../addon-datastore branchRef=main \
8484
COPYRIGHT_YEARS=2026 LOG_LEVEL=DEBUG \
8585
flask run
8686
```
@@ -91,9 +91,9 @@ Required environment variables:
9191

9292
* `PYTHONPATH`: path to `src`
9393
* `TEMP`: path to an existing folder to create temporary locks
94-
* `dataViewsFolder`: path to where your repository of `addon-datastore` is checked out locally
95-
* `branchRef`: Git branch to track for `addon-datastore`
96-
* views-staging/views
94+
* `dataViewsFolder`: path to where your repository of `addonstore-views` is checked out locally
95+
* `branchRef`: Git branch to track for `addonstore-views`
96+
* Default is `refs/heads/main`
9797
* `COPYRIGHT_YEARS`: String of years displayed on web front-end for add-on store
9898
* e.g. 2025-2026
9999

@@ -117,5 +117,5 @@ Test the following scenarios:
117117
* Invalid NVDA API version should return appropriate error
118118

119119
3. Update Endpoint:
120-
* Valid branch update (e.g., `{"ref": "refs/heads/views"}`)
120+
* Valid branch update (e.g., `{"ref": "refs/heads/main"}`)
121121
* Invalid branch reference should be rejected

src/addonStoreApi/transformedSubmissions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def getAvailableParsedApiVersions(self) -> list["MajorMinorPatch"]:
5757
@DataFolder.accessForReading
5858
def _jsonBasedGetAvailableApiVersions(self) -> list[str]:
5959
"""Return API versions listed in the nvdaAPIVersions.json file contained in the transformed submission store:
60-
https://github.com/nvaccess/addon-datastore/blob/views/nvdaAPIVersions.json
60+
https://github.com/nvaccess/addonstore-views/blob/main/nvdaAPIVersions.json
6161
JSON example:
6262
[
6363
{
@@ -134,7 +134,7 @@ def getLatestStableRelease(self) -> "MajorMinorPatch":
134134
@DataFolder.accessForReading
135135
def getRichApiVersions(self) -> list[dict[str, str]]:
136136
"""Return API versions listed in the nvdaAPIVersions.json file contained in the transformed submission store:
137-
https://github.com/nvaccess/addon-datastore/blob/views/nvdaAPIVersions.json
137+
https://github.com/nvaccess/addonstore-views/blob/main/nvdaAPIVersions.json
138138
JSON example:
139139
[
140140
{

src/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ def verify_github_signature(payload_body, signature_header):
452452

453453
@app.route("/update", methods=["POST"])
454454
def update():
455-
"""GitHub webhook endpoint for updating the addon-datastore."""
455+
"""GitHub webhook endpoint for updating addonstore-views."""
456456
# Verify webhook signature
457457
signature_header = request.headers.get("X-Hub-Signature-256")
458458
if not verify_github_signature(request.get_data(), signature_header):
@@ -484,7 +484,7 @@ def update():
484484
return Response("Branch reference missing", status=HTTPStatus.BAD_REQUEST)
485485

486486
# Get the configured branch from environment
487-
configured_branch = os.getenv("branchRef", "refs/heads/views-staging")
487+
configured_branch = os.getenv("branchRef", "refs/heads/main")
488488
if request.json["ref"] != configured_branch:
489489
log.info(
490490
f"Skipping update for non-target branch: got {request.json['ref']}, configured for {configured_branch}",

0 commit comments

Comments
 (0)