Skip to content

Add-scanapi-version #4

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

Merged
merged 6 commits into from
Oct 19, 2020
Merged

Conversation

ShubhamSood1406
Copy link
Member

#3 is solved now and ready to be merged.

@ShubhamSood1406 ShubhamSood1406 requested review from a team as code owners September 30, 2020 20:36
@camilamaia
Copy link
Member

@ShubhamSood1406 for this issue we need to install the scanapi with the corresponding version received from the parameter. I only see the README.md file changed here. Was it by mistake?

@ShubhamSood1406
Copy link
Member Author

@ShubhamSood1406 for this issue we need to install the scanapi with the corresponding version received from the parameter. I only see the README.md file changed here. Was it by mistake?

Can you explain what else to change to fix this issue?

@camilamaia
Copy link
Member

@ShubhamSood1406 I believe these are the steps to make it work:

  1. Add the new input to actions.yml
    https://github.com/scanapi/github-action/blob/master/action.yml#L7
    Something like:
inputs:
  scanapi_version:
    description: 'The ScanAPI version to be installed'
    required: false
    default: 'latest'
  arguments:
    ...
  1. Add the new args to actions.yml
    https://github.com/scanapi/github-action/blob/master/action.yml#L16
args:
    - ${{ inputs.scanapi_version }}
    - ${{ inputs.arguments }}
  1. Remove ScanAPI installation from Docker file. Which means, remove this line: https://github.com/scanapi/github-action/blob/master/Dockerfile#L9

  2. Install ScanAPI dynamically on entrypoint.sh file, accordingly with the input version. Something similar to this

  3. Update README inputs section with the input scanapi_version info

@ShubhamSood1406
Copy link
Member Author

@camilamaia I updated the files, please review it and tell if I need to change anything else.

@camilamaia
Copy link
Member

@ShubhamSood1406 thanks for the changes!

Just one caveat here, we need to ensure all the scanapi CLI arguments will be passed too. This commented line was responsible to do it. You still need to pass all the arguments, except the first, which is the version one.

Also, would you mind ppdating the README inputs section with the input scanapi_version info?

@ShubhamSood1406
Copy link
Member Author

ShubhamSood1406 commented Oct 8, 2020

@ShubhamSood1406 thanks for the changes!

Just one caveat here, we need to ensure all the scanapi CLI arguments will be passed too. This commented line was responsible to do it. You still need to pass all the arguments, except the first, which is the version one.

Also, would you mind ppdating the README inputs section with the input scanapi_version info?

@camilamaia I updated the file, please check and tell if anything else to change.

@ShubhamSood1406
Copy link
Member Author

@camilamaia Please review this PR to be accepted in Hacktoberfest.

Copy link
Member

@camilamaia camilamaia left a comment

Choose a reason for hiding this comment

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

@@ -17,6 +21,7 @@ The following will take the yaml file and produce a scanapi-report.html file as
- name: Run automated API tests
uses: scanapi/github-action@v1
with:
scanapi_version: '==2.0.0'
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
scanapi_version: '==2.0.0'
scanapi_version: '2.0.0'

Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason for removing this feature?

Copy link
Member

Choose a reason for hiding this comment

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

Everything looks good to me. I would probably add a feature to specify the version in PIP version specifier syntax ('==1.2.3', '~=1.2', etc.) as it was added by @ShubhamSood1406. This would add the capability for users to automatically use the latest version if the patch version is changed and not to update when major updates (with braking changes) occur.

Oh, that makes sense, now I got the point of the way you implemented it on poetry-publish. I agree with you 👍

README.md Outdated
@@ -5,6 +5,10 @@ An action that allows developers to run ScanAPI using github actions.

## Inputs

### `scanapi_version`

Default version of scanapi to install.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Default version of scanapi to install.
The version of ScanAPI to install (default: latest).

sh -c "scanapi $*"

if [ $1 != 'latest' ]; then
pip install scanapi$1
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pip install scanapi$1
pip install "scanapi=="$1

@camilamaia camilamaia requested a review from JRubics October 15, 2020 23:21
@camilamaia
Copy link
Member

@JRubics I added you to review this PR since you are the github action expert here! Feel free to suggest any changes :)

@ShubhamSood1406
Copy link
Member Author

Done with the changes according to the suggestions. You can review it. @camilamaia

@JRubics
Copy link
Member

JRubics commented Oct 16, 2020

Everything looks good to me. I would probably add a feature to specify the version in PIP version specifier syntax ('==1.2.3', '~=1.2', etc.) as it was added by @ShubhamSood1406. This would add the capability for users to automatically use the latest version if the patch version is changed and not to update when major updates (with braking changes) occur.

Copy link
Member

@camilamaia camilamaia left a comment

Choose a reason for hiding this comment

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

@ShubhamSood1406 I made the suggestions based on what @JRubics proposed. Sorry for the rework, I did not get the idea of the feature before.

@@ -1,5 +1,9 @@
#!/bin/bash

set -e
Copy link
Member

Choose a reason for hiding this comment

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

@ShubhamSood1406 can we have this back?

README.md Outdated
@@ -17,6 +21,7 @@ The following will take the yaml file and produce a scanapi-report.html file as
- name: Run automated API tests
uses: scanapi/github-action@v1
with:
scanapi_version: '2.0.0'
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
scanapi_version: '2.0.0'
scanapi_version: '==2.0.0' # (PIP version specifier syntax)

entrypoint.sh Outdated
@@ -1,5 +1,9 @@
#!/bin/bash

set -e
if [ $1 != 'latest' ]; then
pip install "scanapi=="$1
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pip install "scanapi=="$1
pip install scanapi$1

@ShubhamSood1406
Copy link
Member Author

@ShubhamSood1406 I made the suggestions based on what @JRubics proposed. Sorry for the rework, I did not get the idea of the feature before.

Done @camilamaia

@camilamaia camilamaia merged commit 90d4c50 into scanapi:master Oct 19, 2020
@camilamaia camilamaia mentioned this pull request Oct 19, 2020
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.

3 participants