Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to review add-ons #1757

Merged
merged 36 commits into from
Nov 1, 2023
Merged

Add ability to review add-ons #1757

merged 36 commits into from
Nov 1, 2023

Conversation

nvdaes
Copy link
Sponsor Contributor

@nvdaes nvdaes commented Oct 11, 2023

Related to nvaccess/nvda#15576

Summary of the issue

Add-ons submitted to the store don't require a previous human review, though some checks are performed automatically to ensure conformance with a predefined json schema, and to avoid the acceptance of add-ons which declare to be tested with non existing API versions.
Though security cannot be warranted, a known place to make and consult human reviews can be provided. This maybe useful to search for feedback of users and reviewers before installing an add-on.

Development process

GitHub Actions have been used to create a discussion for each addonId, and a comment for each submission (add-on version),after add-on metadata is merged to the main branch of the addon-datastore repo.

Some info about created discussions, associated with add-on ids, will be stored in a discussions.json file.

Also, the URL corresponding with the comment for each submission will be stored in the add-on metadata.

Testing performed

Add-ons have been submitted to the nvdaes/addon-datastore repo, emulating the process to be performed in the nvaccess/addon-datastore repo, to test the effect of GitHub Actions.

@nvdaes
Copy link
Sponsor Contributor Author

nvdaes commented Oct 11, 2023

Though this is ready for review, I'd like to comment that, instead of body, maybe more useful to include the resourcePath of the comment. Different urls maybe saved in discussion.json, one for each version, though imo this would be useless since I don't think that a specific location in a webpage can be selected opening it from NVDA gui (i.e., from the store).
Also, I think that create json shouldn't include this. Instead, the discussionUrl, reviewUrl or the name used for this should be optional so metadata is valid with it, but I think that the discussion should be created once the add-on has been validated. Then metadata can be added and the add-on shouldn't need an additional validation.
This doesn't require a merge, to avoid that discussions need to be created manually in manual merges when submitters need to be approval.
I'll wait for more feedback.

@seanbudd seanbudd self-requested a review October 11, 2023 22:25
.github/workflows/checkAndSubmitAddonMetadata.yml Outdated Show resolved Hide resolved
.github/workflows/checkAndSubmitAddonMetadata.yml Outdated Show resolved Hide resolved
.github/workflows/checkAndSubmitAddonMetadata.yml Outdated Show resolved Hide resolved
.github/workflows/checkAndSubmitAddonMetadata.yml Outdated Show resolved Hide resolved
.github/workflows/checkAndSubmitAddonMetadata.yml Outdated Show resolved Hide resolved
repository-id: 'MDEwOlJlcG9zaXRvcnkyMzI4MTU5NTQ='
category-id: 'DIC_kwDODeB9Us4CaB4B'
title: Reviews for ${{ steps.getAddonIdAndVersion.outputs.addonId }} add-on
body: |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a shame that the API doesn't support the polls feature We will have to add these manually and the API might not even allow posting discussion to the category without poll options.

.github/workflows/checkAndSubmitAddonMetadata.yml Outdated Show resolved Hide resolved
@nvdaes
Copy link
Sponsor Contributor Author

nvdaes commented Oct 12, 2023

@seanbudd thanks for your review. If you don't merge this today, I'll test changes on my fork.

@seanbudd
Copy link
Member

I think there are still some unresolved suggestions. Please mark resolved ones as resolved.
I would encourage waiting for another review before testing.

@nvdaes
Copy link
Sponsor Contributor Author

nvdaes commented Oct 12, 2023

@seanbudd I think it's resolved now. Please let me know if I should test this.

with:
script: |
const addonFilename = ${{ needs.getAddonFilename.outputs.addonFileName }}
const addonName = addonFilename.split('/')[1]
Copy link
Member

@seanbudd seanbudd Oct 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is still just using the add-on file name / addonId. Please get the add-on name from the meta data

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is still unresolved

.github/workflows/checkAndSubmitAddonMetadata.yml Outdated Show resolved Hide resolved
.github/workflows/checkAndSubmitAddonMetadata.yml Outdated Show resolved Hide resolved
.github/workflows/checkAndSubmitAddonMetadata.yml Outdated Show resolved Hide resolved
echo ${{ needs.getAddonFilename.outputs.addonFileName }}
)
discussionUrl=$(
echo ${{ steps.createDiscussion.outputs.discussion-url }}
Copy link
Member

@seanbudd seanbudd Oct 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should probably use the url to the comment with the version, not the discussion url

@nvdaes
Copy link
Sponsor Contributor Author

nvdaes commented Oct 12, 2023

We cannot use ${{ github.REPOSITORY_ID }}. This gets the value of an id shown in HTML, I think. This is a numeric value and we need 'MDEwOlJlcG9zaXRvcnkyMzI4MTU5NTQ='

@nvdaes
Copy link
Sponsor Contributor Author

nvdaes commented Oct 12, 2023

@seanbudd hopely this goes in the good way. But unfortunately the create review comment steps throws a syntax error due to a {
If you want, feel free to review this:

https://github.com/nvdaes/addon-datastore/actions/runs/6499804024/job/17654017249#step:7:28

.github/workflows/checkAndSubmitAddonMetadata.yml Outdated Show resolved Hide resolved
.github/workflows/checkAndSubmitAddonMetadata.yml Outdated Show resolved Hide resolved
.github/workflows/checkAndSubmitAddonMetadata.yml Outdated Show resolved Hide resolved
.github/workflows/checkAndSubmitAddonMetadata.yml Outdated Show resolved Hide resolved
.github/workflows/checkAndSubmitAddonMetadata.yml Outdated Show resolved Hide resolved
@nvdaes
Copy link
Sponsor Contributor Author

nvdaes commented Oct 13, 2023 via email

@nvdaes
Copy link
Sponsor Contributor Author

nvdaes commented Oct 13, 2023 via email

@seanbudd
Copy link
Member

@nvdaes - please reply in response to review comments in a threaded manner. email based response makes tracking the review much harder and also includes a lot of extra junk due to your email signature including the body of the text you are responding to.

@nvdaes

This comment was marked as outdated.

@nvdaes
Copy link
Sponsor Contributor Author

nvdaes commented Oct 13, 2023

@seanbudd wrote:

@nvdaes - please reply in response to review comments in a threaded manner.

Sure, sorry for replying via mobile device. Also, Ididn't understand well a question about repo id, and I have marked my comment as oupdated.

@nvdaes
Copy link
Sponsor Contributor Author

nvdaes commented Oct 22, 2023

@seanbudd , unfortunately, for any reasonthat I don't know,though the created PR is merged to masterand the add-on metadata is added to the master branch, the createComment job fails with the following message:

Unhandled error: Error: ENOENT: no such file or directory, open 'addons/eMule/14.0.0.json'

@seanbudd
Copy link
Member

@nvdaes - could you point to a failed action so it can be investigated? My assumption is a git pull is required somewhere

@seanbudd
Copy link
Member

note that there are also merge conflicts here

@seanbudd seanbudd self-requested a review October 22, 2023 23:53
@nvdaes
Copy link
Sponsor Contributor Author

nvdaes commented Oct 23, 2023

could you point to a failed action so it can be investigated? My assumption is a git pull is required somewhere

Thanks @seanbudd . In fact, the checkout action fetches the commitprevious to merge. I'll try to perform a git pull in a next step. You can see a failed action at
https://github.com/nvdaes/addon-datastore/actions/runs/6608423808/job/17947132879#step:3:30

@seanbudd
Copy link
Member

See also actions/checkout#439

@nvdaes
Copy link
Sponsor Contributor Author

nvdaes commented Oct 23, 2023

I think that this is ready for another review. Now worked as expected.
Anyway, the transform workflow, not modified here, raised a decode error. Also,note that the addonId show in parentheses in the discussion title is between quotation marks:

nvdaes#582

Please see the following actions:

https://github.com/nvdaes/addon-datastore/actions/runs/6609167848

https://github.com/nvdaes/addon-datastore/actions/runs/6608903760

author: github-actions <github-actions@github.com>
repository: nvaccess/addon-datastore-transform
path: transform
- name: Validate metadata
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this moved here?
Shouldn't this happen after the PR is created and before it is merged?

This appears to close this issue on failure, without leaving a review comment explaining the validation errors.

body: "Closes #${{ inputs.issueNumber }}"
author: github-actions <github-actions@github.com>
delete-branch: true
mergeToMaster:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is missing a step to check metadata before merging the PR

run: |
cd datastore
git add .
$addonFileName = git diff --cached --name-only
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems fragile - what happens on PRs with multiple file names?
Shouldn't this be tied to the validation checks that only a single file is added a nd no files are modified?

@nvdaes
Copy link
Sponsor Contributor Author

nvdaes commented Oct 25, 2023

@seanbudd , my initial intention is to perform the maximum number of checks before creating pull requests, assuming that just one file could be generated from the issue form, and assuming that nobody can push to addon-datastore in NV Access GitHub account, and that nobody from NV Access people would do it.
Anyway, I have addressed your changes. Please see the transformation workflow since on my GitHub account is always failing:

https://github.com/nvdaes/addon-datastore/actions/runs/6636211592

The only change not tested in the above action is that I have changed checkout to v4 for some step.

@seanbudd
Copy link
Member

The failure in on that line seems intentional - as no review comment exists in discussions.json. If you want to avoid the failure, I would suggest setting an output env variable rather than using exit codes. It seems the real issues is that later on it fails to actually update discussion.json later, and fails to transform due to an encoding issue with the data in your repo.

@nvdaes
Copy link
Sponsor Contributor Author

nvdaes commented Oct 26, 2023

@seanbudd , I've addressed your review so tht the createReviewComment job doesn¡t fail. Unfortunately the transform workflow is stil failing. I don't know what wouldhappen if you test this in the staging repo:

https://github.com/nvdaes/addon-datastore/actions/runs/6658652475

If/when you merge this, please let me know if we should create a job to add discussions and comments for all add-ons. I'm not sure about the result due to multiple calls to the GitHub API. I think that next step would be to change the jsonSchema in addon-datastore-validation, and create an action in NVDA.

@seanbudd
Copy link
Member

I think its possible our step to update the discussion URL is changing the encoding of the addon version JSON file, thus causing the decode issue

@seanbudd
Copy link
Member

I think the API should be fine to handle it, particularly from actions as a source.

@nvdaes
Copy link
Sponsor Contributor Author

nvdaes commented Oct 27, 2023

@seanbudd , the issue with the transformation workflow seems to be fixed:

https://github.com/nvdaes/addon-datastore/actions/runs/6664065150

@nvdaes
Copy link
Sponsor Contributor Author

nvdaes commented Oct 27, 2023

@seanbudd I think that this is ready for a review, which unless you have more suggestions maybe the last one.

The latest discussion doesn't show the add-on id between quotation marks in the title:

nvdaes#687

When you merge this, I will work in a different PR trying to generate comments for all versions of add-ons.

Copy link
Member

@seanbudd seanbudd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nvdaes for all your hard work on this, changes look good to me

.github/workflows/checkAndSubmitAddonMetadata.yml Outdated Show resolved Hide resolved
.github/workflows/sendJsonFile.yml Outdated Show resolved Hide resolved
@seanbudd
Copy link
Member

seanbudd commented Nov 1, 2023

Could you update the PR description to be more descriptive?

e.g. summary of issue, development process, testing

@nvdaes
Copy link
Sponsor Contributor Author

nvdaes commented Nov 1, 2023

@seanbudd , I've updatedthe PR description. When you merge this, I'll work trying to create comments for all submissions in their corresponding discussions, or other steps that you consider appropriate like working in the addon-datastore-validation or to create an action in NVDA. We can use this code for further steps, in particular for GitHub Actions, so I prefer to wait until this is merged.

@seanbudd seanbudd merged commit 121b247 into nvaccess:master Nov 1, 2023
nvdaes added a commit to nvdaes/addon-datastore that referenced this pull request Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants