1. git issue ops - np-reddy/git-issue-ops GitHub Wiki

git-issue-ops


How it Works!

Repository np-reddy/git-issue-ops is used for defining the necessary objects and workflows to create repository in Artifactory and sync the users from github repository to artifcatory.

Prerequisites:

Workflow

  1. User creates an issue using Issue template and provides following details.
github.repo.name=devops1
arti.repo.type=local
arti.repo.package=ivy
  1. Actions workflow is designed to trigger on issue opened (also, edited for testing the workflow) and checks for issue label arti-repo defined in our issue template.
  2. Workflow can run on either GitHub-Hosted (ubuntu-latest) or self-hosted (ex.mylaptop).
  3. Checkout the code from the repo using actions/checkout@v1
  4. Parse the issue description and extract gh repo, rt repo type, pkg type. Store them in separate files on runner workspace so that these can be retrieved from other jobs whenever needed. Passing global env variables is also considered for passing variables but it is more complex (for me, at least 😉) and error prone.
  5. Get the gh repo user permissions using collaborators api call and map them into admins, readers and writers based on the repo permissions, copy these to separate files on workspace.
  6. Set the JFrog CLI env using jfrog/setup-jfrog-cli@v1
  7. Prepare necessary object creation templates and set env varibales.
  8. Create arti users and set default passowords and dummy emails (It is not possible to retrieve emails from GH if user chose the email to be private, not even from commit logs, I tried 🤷 ) Note: User validation if already present is not included, will be considered for enhancements.
  9. Create arti groups and assign the users according to the user maps we have created earlier.
  10. Create arti repo using env variables and arti repo template. Note: Only local repos can be created for now.
  11. Create arti permission target using permission template and env varibales, this will tag the repos and groups with required access. Note: Users are excluded from perm target as it is less complex to use groups.

Now, all the required objects are created in Artifactory and ready for use.

Enhancements to be Planned

  1. Issue description validation for gh repo-name, arti repo-type, arti repo-pkg.
  2. Validation for existing users and repos in artifactory
  3. Creation of remote repos
  4. Feedback to issue after object creation by using comment.