-
Notifications
You must be signed in to change notification settings - Fork 11
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
Automate the Config Creation Process #46
Conversation
using this template, new deployers who are interested in working with us can fill out specifically what they want to do, in a controlled form manner -- used as input to a workflow
When an issue is created or updated, a workflow is set off that converts the templated issue into a json file, and submits it as a pr if the issue is updated, so will the pr
adding a conditional to skip the job if it is not using the issue template
with these try/catch blocks, the goal is to catch any errors as they happen, and throw a failure message specific to that section of the process By indicating where the problem was encountered, it should be easier to fix The goal would be to enforce all of the controls we need through the form itself, such that people cannot submit invalid forms, but there are limitations to the issue template
More form updates as I practice using this in my local repo:
|
we've found that these notifications tend to annoy users, so it should certainly be something that must be enabled rather than something that must be enabled
these are commented out for now, as their values are hardcoded, but in case we decide to reintroduce them, fixing the formatting of these
this section will host trip and reminder scheme customization that is difficult to set up through a form -- I'm going to move forward with setting up with a form for it, but we will need to check the results against the description of what is desired more than likely
extrapolated, since they don't exist yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to merge this for now so that we can see how it looks, but have some comments that can be addressed in a future PR
validations: | ||
required: true | ||
- type: input | ||
id: deployment_partner_name_lang1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there no way to have this be an array instead of hardcoded lang1
, lang2
...? What if some programs want to have more than 2 languages? Most election material in my county, for example, has at least 4 languages - English, Spanish, Mandarin and Vietnamese.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If not, maybe we will need to create multiple templates for the number of languages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I end up compiling it into an array, but this was the best way I found to format the template - the options are relatively limited, multiple templates could work
id: trip_survey_path | ||
attributes: | ||
label: Custom Trip Survey | ||
description: Please add a path to a trip survey, something like "https://raw.githubusercontent.com/sebastianbarry/nrel-openpath-deploy-configs/surveys-info-and-surveys-data/survey-resources/data-json/trip-end-survey-multiple-select.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should really merge this so that the example is not in @sebastianbarry's repo
@sebastianbarry can you submit a PR?
import { readFile } from "node:fs/promises"; | ||
import { setFailed } from "@actions/core"; | ||
import yaml from "js-yaml"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is inspired by some other file, make sure to link it here and ensure that the LICENSE is correct
Note that issues were not enabled on this repo, and I had to enable them to (hopefully) get this to work. |
Seems to work now - I can at least create an issue... |
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 |
I am pretty sure that workflows are enabled. wrt enabling creation of pull requests, I think you can use the `GitHub actions token" and enable pull requests on it Do you want to create a test issue and see what it does? |
It works! But is overzealous with the commits, I'll include a fix for that in my cleanup. |
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:
This is in an early draft stage, as I still have things to work out:
Related Issue