diff --git a/CODEOWNERS.md b/CODEOWNERS.md index 1cba367..04f0761 100644 --- a/CODEOWNERS.md +++ b/CODEOWNERS.md @@ -3,8 +3,16 @@ [@decause-gov](https://github.com/decause-gov) [@natalialuzuriaga](https://github.com/natalialuzuriaga) [@IsaacMilarky](https://github.com/IsaacMilarky) +[@sachin-panayil](https://github.com/sachin-panayil) +[@DinneK](https://github.com/DinneK) -# Shoutouts +## Repository Domains + +- Repository Templates in `/tier*/` [@natalialuzuriaga](https://github.com/natalialuzuriaga) [@sachin-panayil](https://github.com/sachin-panayil) [@IsaacMilarky](https://github.com/IsaacMilarky) +- Outbound Checklists in `/tier*/checklist.md` [@natalialuzuriaga](https://github.com/natalialuzuriaga) +- GitHub Actions in `/.github` [@sachin-panayil](https://github.com/sachin-panayil) [@IsaacMilarky](https://github.com/IsaacMilarky) [@natalialuzuriaga](https://github.com/natalialuzuriaga) + +## Shoutouts [@usdigitalresponse](https://github.com/usdigitalresponse) @@ -14,6 +22,12 @@ Thank you [US Digital Response](https://www.usdigitalresponse.org/) Team for your support creating this repository! +[Coding It Forward Fellows](https://codingitforward.com/fellowship) + +- [@Firebird1029](https://github.com/Firebird1029) +- [@CreativeNick](https://github.com/CreativeNick) +- [@RicardoZamora01](https://github.com/RicardoZamora01) + # Questions? Email opensource@cms.hhs.gov diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..7c7373b --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,17 @@ +## Contributor Code of Conduct + +As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities. + +We are committed to making participation in this project a harassment-free experience for everyone, regardless of the level of experience, gender, gender identity, expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion. + +Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned with this Code of Conduct. + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers at opensource@cms.hhs.gov. + +This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/) + +## Acknowledgements + +This CODE_OF_CONDUCT.md was originally forked from the [United States Digital Service](https://usds.gov) [Justice40](https://thejustice40.com) open source [repository](https://github.com/usds/justice40-tool), and we would like to acknowledge and thank the community for their contributions. diff --git a/COMMUNITY_GUIDELINES.md b/COMMUNITY_GUIDELINES.md new file mode 100644 index 0000000..8f7172f --- /dev/null +++ b/COMMUNITY_GUIDELINES.md @@ -0,0 +1,37 @@ +# repo-scaffolder Open Source Community Guidelines + +This document contains principles and guidelines for participating in the repo-scaffolder open source community. + +## Principles + +These principles guide our data, product, and process decisions, architecture, and approach. + +- Open means transparent and participatory. +- We take a modular and modern approach to software development. +- We build open-source software and open-source process. +- We value ease of implementation. +- Fostering community includes building capacity and making our software and processes accessible to participants with diverse backgrounds and skillsets. +- Data (and data science) is as important as software and process. We build open data sets where possible. +- We strive for transparency for algorithms and places we might be introducing bias. + +## Community Guidelines + +All community members are expected to adhere to our [Code of Conduct](CODE_OF_CONDUCT.md). + +Information on contributing to this repository is available in our [Contributing file](CONTRIBUTING.md). + +When participating in the repo-scaffolder open source community conversations and spaces, we ask individuals to follow the following guidelines: + +- When joining a conversation for the first time, please introduce yourself by providing a brief intro that includes: + - your related organization (if applicable) + - your pronouns + - your superpower, and how you hope to use it for {{ cookiecutter.project_name }} +- Embrace a culture of learning, and educate each other. We are all entering this conversation from different starting points and with different backgrounds. There are no dumb questions. +- Take space and give space. We strive to create an equitable environment in which all are welcome and able to participate. We hope individuals feel comfortable voicing their opinions and providing contributions and will do our best to recognize and make space for individuals who may be struggling to find space here. Likewise, we expect individuals to recognize when they are taking up significant space and take a step back to allow room for others. + +- Be respectful. +- Default to positive. Assume others' contributions are legitimate and valuable and that they are made with good intention. + +## Acknowledgements + +This COMMUNITY_GUIDELINES.md was originally forked from the [United States Digital Service](https://usds.gov) [Justice40](https://thejustice40.com) open source [repository](https://github.com/usds/justice40-tool), and we would like to acknowledge and thank the community for their contributions. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2396b26..e9010cc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,3 @@ - - # How to Contribute We're so thankful you're considering contributing to an [open source project of @@ -13,16 +11,36 @@ We encourage you to read this project's CONTRIBUTING policy (you are here), its ## Getting Started - +First, install the required dependencies. + +To create a new repository using repo-scaffolder, run the production version of repo-scaffolder. Subsitute `X` with the tier number you'd like to create in the directory flag. + +``` +cookiecutter https://github.com/DSACMS/repo-scaffolder --directory=tierX +``` + +More commands on using repo-scaffolder for repository creation and maintenance can be found here: https://github.com/DSACMS/repo-scaffolder/blob/main/README.md#Using-repo-scaffolder + +### Team Specific Guidelines + +- Please try to keep pull requests to a reasonable size; try to split large contributions to multiple PRs +- Please create pull requests into dev unless the contribution is some kind of bugfix or urgent hotfix. +- Document and explain the contribution clearly according to provided standards when possible. +- Feel free to reach out to us if there is any confusion. A list of the project maintainers is found here: [MAINTAINERS.md](./MAINTAINERS.md) ### Building dependencies -In the root directory of the project, -`pip install -r requirements.txt` +1. Clone the repo + + `git clone https://github.com/DSACMS/metrics.git` + +2. Install the required packages in requirements.txt + + `pip install -r requirements.txt` ### Building the Project - +N/A ### Workflow and Branching @@ -37,13 +55,17 @@ We follow the [GitHub Flow Workflow](https://guides.github.com/introduction/flow 7. Wait for your change to be pulled into `cmsgov/cmsgov-example-repo/main` 8. Delete your feature branch +### Testing Conventions + + + ### Coding Style and Linters -This project strives to adhere to the Python Style Guide (http://peps.python.org/pep-0008/). We would recommend using a linter such as pyflakes, flake8, black, or other plugin for your editor or IDE of choice. + ---> +Each application has its own linting and testing guidelines. Lint and code tests are run on each commit, so linters and tests should be run locally before commiting. -### Issues +### Writing Issues When creating an issue please try to adhere to the following format: @@ -63,7 +85,7 @@ When creating an issue please try to adhere to the following format: see our .github/ISSUE_TEMPLATE.md for more examples. -### Pull Requests +### Writing Pull Requests Comments should be formatted to a width no greater than 80 columns. @@ -107,7 +129,7 @@ a development branch for additional testing. Once the changes are merged, they w be pushed back to the main branch. If the issue the pull request is addressing is particularly urgent, the pull request -will be merged directly into the main branch. +will be merged directly into the main branch. ## Documentation @@ -124,7 +146,7 @@ questions, just [shoot us an email](mailto:opensource@cms.hhs.gov). ### Security and Responsible Disclosure Policy -*Submit a vulnerability:* Vulnerability reports can be submitted through [Bugcrowd](https://bugcrowd.com/cms-vdp). Reports may be submitted anonymously. If you share contact information, we will acknowledge receipt of your report within 3 business days. +_Submit a vulnerability:_ Vulnerability reports can be submitted through [Bugcrowd](https://bugcrowd.com/cms-vdp). Reports may be submitted anonymously. If you share contact information, we will acknowledge receipt of your report within 3 business days. For more information about our Security, Vulnerability, and Responsible Disclosure Policies, see [SECURITY.md](SECURITY.md). diff --git a/GOVERNANCE.md b/GOVERNANCE.md new file mode 100644 index 0000000..1178385 --- /dev/null +++ b/GOVERNANCE.md @@ -0,0 +1,5 @@ +# Governance + + + +This project is governed by our [Community Guidelines](COMMUNITY_GUIDELINES.md) and [Code of Conduct](CODE_OF_CONDUCT.md). diff --git a/MAINTAINERS.md b/MAINTAINERS.md new file mode 100644 index 0000000..3744b42 --- /dev/null +++ b/MAINTAINERS.md @@ -0,0 +1,38 @@ +## Maintainers + + + +This is a list of maintainers for this project. See [CODEOWNERS.md](./CODEOWNERS.md) for list of reviewers for different parts of the codebase. Team members include: + +- [@decause-gov](https://github.com/decause-gov) +- [@natalialuzuriaga](https://github.com/natalialuzuriaga) +- [@IsaacMilarky](https://github.com/IsaacMilarky) +- [@sachin-panayil](https://github.com/sachin-panayil) +- [@DinneK](https://github.com/DinneK) + +## Approvers: + +- [@decause-gov](https://github.com/decause-gov) + +## Reviewers: + +- [@natalialuzuriaga](https://github.com/natalialuzuriaga) +- [@IsaacMilarky](https://github.com/IsaacMilarky) +- [@sachin-panayil](https://github.com/sachin-panayil) +- [@DinneK](https://github.com/DinneK) + +| Roles | Responsibilities | Requirements | Defined by | +| -------- | :--------------------------------------------- | :-------------------------------------------------------------------------------- | :---------------------------------------------------------- | +| member | active contributor in the community | multiple contributions to the project. | PROJECT GitHub org Committer Team | +| reviewer | review contributions from other members | history of review and authorship in a sub-project | MAINTAINERS file reviewer entry, and GitHub Org Triage Team | +| approver | approve accepting contributions | highly experienced and active reviewer + contributor to a sub-project | MAINTAINERS file approver entry and GitHub Triage Team | +| lead | set direction and priorities for a sub-project | demonstrated responsibility and excellent technical judgement for the sub-project | MAINTAINERS file owner entry and GitHub Org Admin Team | + +## Contributors + + + +Total number of contributors: + + + diff --git a/README.md b/README.md index a74ef5c..b5d3d0e 100644 --- a/README.md +++ b/README.md @@ -1,50 +1,150 @@ -# Repo Scaffolder +# repo-scaffolder + Templates and commandline tools for creating repositories for US Federal open source projects -## Prerequisites +## About the Project + +The CMS Open Source Program Office developed a [maturity model framework](https://github.com/DSACMS/repo-scaffolder/blob/main/maturity-model-tiers.md) to classify federal open source projects based on their maturity level. Each tier outlines specific files and content that are required or recommended to be included in the repository. + +repo-scaffolder assists project teams with creating repositories that adhere to repository hygiene standards. It provides file templates detailing project information, contributing guidance, maintainer roles, project metadata, community involvement, feedback mechanisms, governance, security policies, and more. Using [cookiecutter](https://github.com/cookiecutter/cookiecutter), repo-scaffolder helps teams identify what tier their project is classified as and fill in project information to be inputted into the file templates. In turn, this provides the project sufficient structure and foundation to promote a healthy open source ecosystem + +This repository also includes [outbound checklists](#Outbound-Checklists) for each tier outlining the review process for releasing repositories as open source. + +For existing repositories, repolinter via GitHub Actions is used to identify any files and information missing from the repository according to their maturity tier. + + + + + + + + + + + +## Core Team + +An up-to-date list of core team members can be found in [MAINTAINERS.md](MAINTAINERS.md). At this time, the project is still building the core team and defining roles and responsibilities. We are eagerly seeking individuals who would like to join the community and help us define and fill these roles. + +## Documentation Index + + + +##### Usage + +- [Using repo-scaffolder](#Using-repo-scaffolder) +- [Updating repositories using GitHub Actions](#Updating-projects-with-new-repo-scaffolder-upstream-file-changes) +- [Documentation](./docs) + +##### Maturity Models + +- [Maturity Model Framework](./maturity-model-tiers.md) +- [Tier 0](./tier0/README.md) +- [Tier 1](./tier1/README.md) +- [Tier 2](./tier2/README.md) +- [Tier 3](./tier3/README.md) +- [Tier 4](./tier4/README.md) + +##### Outbound Checklists + +- [Tier 1](./tier1/checklist.md) +- [Tier 2](./tier2/checklist.md) +- [Tier 3](./tier3/checklist.md) +- [Tier 4](./tier4/checklist.md) + +##### Files + +- [CONTRIBUTING.md](./CONTRIBUTING.md) +- [MAINTAINERS.md](./MAINTAINERS.md) +- [CODEOWNERS.md](./CODEOWNERS.md) +- [COMMUNITY_GUIDELINES.md](./COMMUNITY_GUIDELINES.md) +- [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) +- [SECURITY.md](./SECURITY.md) +- [LICENSE](./LICENSE) + +## Repository Structure + + + + +## Using repo-scaffolder + +### Create a new repository using repo-scaffolder + +The Open Source Program Office follows a maturity model framework to classify federal repositories according to their level of maturity: https://github.com/DSACMS/repo-scaffolder/blob/main/maturity-model-tiers.md. + +There are 4 tiers in the maturity model framework. The `/tier*` directory consists of templates, files, and scripts for each respective tier: + +- `{{cookiecutter.project_slug}}` is the directory containing templates and files to be generated upon repository creation. This serves as your repository starting point. +- `cookiecutter.json` defining the questions cookiecutter asks. +- `hooks`, a folder containing scripts to be run upon repository creation. +- `checklist.md` & `checklist.pdf` is the outbound review checklist with guidelines on releasing the repository as open source. +- `README.md` with more information about the maturity tier and file contents. + +#### Prerequisites + - python - github cli -- cookiecutter +- [cookiecutter](https://github.com/cookiecutter/cookiecutter) - [repolinter](https://github.com/todogroup/repolinter) -## Need help picking a tier? -If you do not know what tier your project is, the cookiecutter will walk you through questions to figure out what tier you need. Run: +#### Need help picking a maturity tier? + +If you do not know what tier your project is, the cookiecutter will walk you through questions to figure out what tier you need. Run: + ``` cookiecutter https://github.com/DSACMS/repo-scaffolder ``` -## Know what tier you need? -If you know what tier you need, you can run the cookiecutter for an individual tier. Use the below command with `X` substituted for the tier number. +#### Know what maturity tier you need? + +If you know what tier you need, you can run the cookiecutter for an individual tier. Use the below command with `X` substituted for the tier number. + ``` cookiecutter https://github.com/DSACMS/repo-scaffolder --directory=tierX ``` -## Add code.json to your project -To add code.json into your project, navigate to your project's `.github` directory and run the following cookiecutter command. You will be asked questions about the project (see cookiecutter.json) in order to collect and store this metadata in code.json. -``` -cookiecutter . --directory=codejson -``` +### Update an existing repository using repo-scaffolder + +You can update existing projects with repo-scaffolder. Using the `-s` flag on cookiecutter will not overwrite existing files. Follow these steps: -## Existing Projects -You can update existing projects with the repo scaffolder. Using the `-s` flag on cookiecutter will not overwrite existing files. Follow these steps: 1. Create a new branch in your repo 2. cd into folder above 3. run: `cookiecutter -f -s https://github.com/DSACMS/repo-scaffolder --directory=tierX` 4. Make sure when answering the questions you use the existing folder/project name 5. Raise pr into main -## Updating Projects -When creating projects, if you want to receive updates then add `dsacms-tierX` as a github topic to the repo. The scaffolder repo includes github workflows that will find all repos with that tag and can raise a pull request with an updated string or adding a file. See [actions.md](https://github.com/DSACMS/repo-scaffolder/blob/main/.github/actions.md) for more information. +### Metadata collection using code.json -## Editing or Adding Tiers -At a top level, each tier consists of a folder for `hooks`, a folder containing the files to be added (`{{cookiecutter.project_slug}}`), and a `cookiecutter.json` defining the questions cookiecutter asks. These naming conventions must be -followed as that is what cookiecutter picks up. The `hooks` folder needs to be duplicated in each tier. The folder -containing the files to be added can include slugged out variables such as `{{ cookiecutter.project_name }}` that can -be filled in by the answers to `cookiecutter.json`. For example, `{{ cookiecutter.project_name }}` will be filled in by -this question - `"project_name": "My Project",`. See the [cookiecutter docs](https://cookiecutter.readthedocs.io/en/stable/) -for more information. + -## Repolinter +#### Add code.json to your project + +Each repository should contain a code.json file with metadata about the project. + +To add code.json into your project, navigate to your project's `.github` directory and run the following cookiecutter command. You will be asked questions about the project (see cookiecutter.json) in order to collect and store this metadata in code.json. + +``` +cookiecutter . --directory=codejson +``` + +### Maintaining your repository using repo-scaffolder + +#### Updating projects with new repo-scaffolder upstream file changes + +When creating projects, if you want to receive updates then add `dsacms-tierX` as a github topic to the repo. The scaffolder repo includes github workflows that will find all repos with that tag and can raise a pull request with an updated string or adding a file. See [actions.md](https://github.com/DSACMS/repo-scaffolder/blob/main/.github/actions.md) for more information. + +### Identify missing files and information using repolinter + + Repolinter is a tool maintained by the [TODOGroup](https://todogroup.org/) for checking repositories for common open source issues, using pre-defined rulesets. This can be run stand-alone as a script, pre-commit in your IDE, or post-commit or within CI/CD systems! @@ -64,10 +164,78 @@ repolinter lint . repolinter lint tier4/\{\{cookiecutter.project_slug\}\} ``` -## Maturity Models -See our Maturity Model Tiers Document for reference: https://github.com/DSACMS/repo-scaffolder/blob/main/maturity-model-tiers.pdf +#### Automated repolinter actions +A tool to automatically update repositories up to hygenic standards with the use of [Repolinter through GitHub Actions](https://github.com/DSACMS/repolinter-actions) is also available. This action sends a PR to your repository with templates of all the missing files and sections that are required using a predefined rulset. Visit the repository for more information on how to get this action up and running. + +# Development and Software Delivery Lifecycle + +The following guide is for members of the project team who have access to the repository as well as code contributors. The main difference between internal and external contributions is that external contributors will need to fork the project and will not be able to merge their own pull requests. For more information on contributing, see: [CONTRIBUTING.md](./CONTRIBUTING.md). + +## Local Development + +This project contains several different features. + +- `/tier*` contains file templates for repository creation and metadata collection using cookiecutter. Refer to the README.mds to learn more about the file contents. +- `/.github` contains GitHub actions to update repositories contents across the ecosystem. +- `checklist.md` & `checklist.pdf` is the outbound review checklist with guidelines on releasing the repository as open source. +- `maturity-model-tiers.md` & `maturity-model-tiers.pdf` contain information about our maturity model framework. + +### Editing/adding tiers and template contents in repo-scaffolder + +At a top level, each tier consists of a folder for `hooks`, a folder containing the files to be added (`{{cookiecutter.project_slug}}`), and a `cookiecutter.json` defining the questions cookiecutter asks. These naming conventions must be followed as that is what cookiecutter picks up. The `hooks` folder needs to be duplicated in each tier. The folder containing the files to be added can include slugged out variables such as `{{ cookiecutter.project_name }}` that can be filled in by the answers to `cookiecutter.json`. +For example, `{{ cookiecutter.project_name }}` will be filled in by this question - `"project_name": "My Project",`. + +See the [cookiecutter docs](https://cookiecutter.readthedocs.io/en/stable/) +for more information. + + + +## Coding Style and Linters + + + +Each application has its own linting and testing guidelines. Lint and code tests are run on each commit, so linters and tests should be run locally before commiting. + +## Branching Model + +This project follows [trunk-based development](https://trunkbaseddevelopment.com/), which means: + +- Make small changes in [short-lived feature branches](https://trunkbaseddevelopment.com/short-lived-feature-branches/) and merge to `dev` frequently. +- Be open to submitting multiple small pull requests for a single ticket (i.e. reference the same ticket across multiple pull requests). +- Treat each change you merge to `dev` as immediately deployable to production. Do not merge changes that depend on subsequent changes you plan to make, even if you plan to make those changes shortly. +- Ticket any unfinished or partially finished work. +- Tests should be written for changes introduced, and adhere to the text percentage threshold determined by the project. + +This project uses **continuous deployment** using [Github Actions](https://github.com/features/actions) which is configured in the [./github/workflows](.github/workflows) directory. + +Pull-requests are merged to `dev` and the changes are immediately deployed to the development environment. Releases are created to push changes to production in the `main` branch. + +## Contributing + +Thank you for considering contributing to an Open Source project of the US Government! For more information about our contribution guidelines, see [CONTRIBUTING.md](CONTRIBUTING.md). + +## Codeowners + +The contents of this repository are managed by the CMS Open Source Program Office. Those responsible for the code and documentation in this repository can be found in [CODEOWNERS.md](CODEOWNERS.md). + +## Community + +The repo-scaffolder team is taking a community-first and open source approach to the product development of this tool. We believe government software should be made in the open and be built and licensed such that anyone can download the code, run it themselves without paying money to third parties or using proprietary software, and use it as they will. + +We know that we can learn from a wide variety of communities, including those who will use or will be impacted by the tool, who are experts in technology, or who have experience with similar technologies deployed in other spaces. We are dedicated to creating forums for continuous conversation and feedback to help shape the design and development of the tool. + +We also recognize capacity building as a key part of involving a diverse open source community. We are doing our best to use accessible language, provide technical and process documents, and offer support to community members with a wide variety of backgrounds and skillsets. + +### Community Guidelines + +Principles and guidelines for participating in our open source community are can be found in [COMMUNITY_GUIDELINES.md](COMMUNITY_GUIDELINES.md). Please read them before joining or starting a conversation in this repo or one of the channels listed below. All community members and participants are expected to adhere to the community guidelines and code of conduct when participating in community spaces including: code repositories, communication channels and venues, and events. + +## Feedback + +If you have ideas for how we can improve or add to our capacity building efforts and methods for welcoming people into our community, please let us know at opensource@cms.hhs.gov. If you would like to comment on the tool itself, please let us know by filing an **issue on our GitHub repository.** ## Acknowlegements + This project was developed as a collaboration between the United States Digital Service ([USDS.gov](https://usds.gov)), The Department of Health and Human Services ([HHS.gov](https://hhs.gov)), The Digital Service at the Centers for @@ -84,7 +252,7 @@ questions, just [shoot us an email](mailto:opensource@cms.hhs.gov). ### Security and Responsible Disclosure Policy -*Submit a vulnerability:* Vulnerability reports can be submitted through [Bugcrowd](https://bugcrowd.com/cms-vdp). Reports may be submitted anonymously. If you share contact information, we will acknowledge receipt of your report within 3 business days. +_Submit a vulnerability:_ Vulnerability reports can be submitted through [Bugcrowd](https://bugcrowd.com/cms-vdp). Reports may be submitted anonymously. If you share contact information, we will acknowledge receipt of your report within 3 business days. For more information about our Security, Vulnerability, and Responsible Disclosure Policies, see [SECURITY.md](SECURITY.md). @@ -106,4 +274,3 @@ dedication](https://creativecommons.org/publicdomain/zero/1.0/) as indicated in All contributions to this project will be released under the CC0 dedication. By submitting a pull request or issue, you are agreeing to comply with this waiver of copyright interest. -