e-mission / nrel-openpath-deploy-configs

Configurations for current OpenPATH deployments, published for transparency
BSD 3-Clause "New" or "Revised" License
2 stars 9 forks source link

Automate the Config Creation Process #46

Closed Abby-Wheelis closed 8 months ago

Abby-Wheelis commented 8 months ago

After some trial and error, I have begun a workflow which will automatically create a PR for new config files after someone files the templated issue form to create them.

Steps:

  1. deployer fills out a templated issue
  2. creation/update of issue launches workflow that:
    • converts the issue to a json file
    • submits a PR to add the json file to our repo
  3. TBD workflow for ensuring the PR is valid
  4. We check the PR for validity and merge into repo
    • check that it is a valid deployment (not an attack)
    • check for associated "promised" files like onboarding survey, labels, or trip survey
    • may need to do some work by hand for some custom nitty gritty (still working out form templating for trip survey or custom reminder scheme cases)

This is in an early draft stage, as I still have things to work out:

Related Issue

Abby-Wheelis commented 8 months ago

More form updates as I practice using this in my local repo:

shankari commented 8 months ago

Note that issues were not enabled on this repo, and I had to enable them to (hopefully) get this to work.

shankari commented 8 months ago

Seems to work now - I can at least create an issue...

Abby-Wheelis commented 8 months ago

For the actions to run, I think you'll need to make sure that workflows are enabled and that they have permission to create pull requests

shankari commented 8 months ago

I am pretty sure that workflows are enabled. https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#enabling-workflows-for-private-repository-forks

wrt enabling creation of pull requests, I think you can use the `GitHub actions token" and enable pull requests on it https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

Do you want to create a test issue and see what it does?

Abby-Wheelis commented 8 months ago

It works! But is overzealous with the commits, I'll include a fix for that in my cleanup.

see the PR here