
This project contains a python script that extracts mentioned repositories, checks the version of the mentioned dependencies by comparing them with the required versions and provides an option to update the dependencies to the required version if they are dated, thus generating a pull request with the updated dependency versions, automating and making it more convenient for the user.
Exe File Link for the tool - https://drive.google.com/drive/folders/1sV3iI87N9dV5WRtaKPcOimOAyde7g6-w?usp=sharing
Table of Contents
This project contains a python script that checks specified repositories for whether the specified dependencies satisfy specified version requirements by crawling the package.json and package-lock.json file. It produces an output file stating the validation of the satisfaction of each repository. Another feature of the project involves updation of the dependencies and creation of a pull request for the same and stating of the pull request link in an output file.
In order for the tool to work, it is mandatory that the repositories being worked upon belong to the user or contains the user as a collaborator in order for the tool to function appropriately.
Given below are the libraries/packages required beforehand for smooth functioning of the tool/script along with their install command.
-
npm
npm install npm@latest -g
-
typer
pip install typer
-
python-git
pip install python-git
-
os
pip install os
-
glob
pip install glob
-
json
pip install json
-
requests
pip install requests
-
subprocess
pip install subprocess
-
PyGithub
pip install github
- Clone the repo
git clone https://github.com/Anirudh-Mishra/dyte-vit-2022-Anirudh-Mishra.git)
- Install NPM and python packages as mentioned in prerequisite section
npm install <package_name> pip install <package_name>
- Generate a personal github access token by navigating to Setting>Developer Options>Personal Access Tokens.
-
Create a CSV file by a custom name <data_file_name> containing two columns namely, the repository name and the repository link.
-
Open terminal/cmd on your desktop and navigate to the directory of the cloned project.
-
Type the following command if you just want an intimation as to which repositories do not match the requirement of the stated version of a dependency
python ./index.py <data_file_name>.csv <dependency_name>@<required_version> --no-update
Or if you have downloaded the index.exe file you may use the command
index <data_file_name>.csv <dependency_name>@<required_version> --no-update
If you want to further create a pull request for updation proceed to further steps.
-
Type the following command if you want to create a pull request of the updation changes of the stated dependency to required version
index <data_file_name>.csv <dependency_name>@<required_version> --update
Or if you have downloaded the index.exe file you may use the command
index <data_file_name>.csv <dependency_name>@<required_version> --update
-
Go to the repositories that you created to check whether a new branch by the name 'updated-branch' has been created in case of inadequate dependency versions to mark the success of required changes.
-
Go to the pull requests section in the repository. A newly formed pull request denotes success of the procedure and can be merged as and when required!
- Crawl through repositories to detect specified dependency versions
- Write the validity of the dependency versions with respect to the required specified versions to an output file
- Update the version of the required dependecies in the desired repository clones
- Create a pull request on a public as well as private repository belonging to the user
Anirudh Mishra - Anirudh30502 - [email protected]
Project Link: https://github.com/Anirudh-Mishra/dyte-vit-2022-Anirudh-Mishra