Skip to content

Latest commit

 

History

History
258 lines (221 loc) · 11 KB

create-senzing-github-repository.md

File metadata and controls

258 lines (221 loc) · 11 KB

How to create Senzing GitHub repository

This is a checklist of what to set when creating a new GitHub Repository.

Owner actions

  1. Identify the GitHub Organization the repository will belong to.
    • One of < Senzing | senzing-factory| senzing-garage >.
    • Will be henceforth referred to as <ORG> and should be substituted with a value from above.
    • NOTE: There are slight differences between organization selections in this document. Where applicable options will be listed for each organization. Please be sure to select the options for the respective organization.
  2. Visit github.com/<ORG>
  3. Log in as an administrator.
  4. On github.com/<ORG>, click the New button under the Repositories header.
    1. Enter Respository Name
      1. Use only lower-case letters, numbers, and hyphens.
      2. Avoid use of underscore.
      3. When appropriate, use prefixes to help in searching for repositories. Examples:
        • docker- for docker-based repositories
        • go- for (non-command) go-based repositories
          • go-...ing - for cross-cutting concerns
        • mapper- for mapper functions
    2. Choose 🔘 Public unless otherwise advised.
    3. Check ☑️ Initialize this repository with: Add a README file
    4. If appropriate, add .gitignore
    5. For Choose a license, choose Apache License 2.0
    6. Click Create repository button.
  5. On repository home page, in Releases section:
    1. Click Create a new release link.
    2. Tag version: 0.0.0
    3. Release title: 0.0.0
    4. Click Publish release button.
  6. On repository home page, click Settings tab.
    1. Click Collaborators & teams tab.
      1. Click Add teams button.
        1. Type one of the following for the respective organization into the test box and click to select:
          1. Senzing: Senzing/build
          2. senzing-factory: senzing-factory/senzing-factory-admin
          3. senzing-garage: senzing-garage/senzing-garage-admin
        2. Choose a role: Admin
        3. Click Add <ORG>/<Team selection from above>

Admin actions

Branch Protection Rules

  1. On repository home page, click Settings tab.
    1. Click Branches tab.
    2. Click Add classic branch protection rule
      1. Branch name pattern: main
      2. Protect matching branches section
        1. ☑️ Require a pull request before merging
          1. ☑️ Require approvals
          2. ☑️ Require review from Code Owners
      3. ☑️ Require signed commits
      4. Click Create button

Collaborators & teams

  1. On repository home page, click Settings tab.
    1. Click Collaborators & teams tab.
      1. For ALL organizations:
        1. Click Add teams button.
          1. Type senzing-automation
          2. Choose <ORG>/senzing-automation
          3. Choose a role: Write
          4. Click Add <ORG>/senzing-automation
        2. Click Add teams button.
          1. Type senzing-devsecops
          2. Choose <ORG>/senzing-devsecops
          3. Choose a role: Write
          4. Click Add <ORG>/senzing-devsecops
        3. Click Add teams button.
          1. Type senzing-project-managers
          2. Choose <ORG>/senzing-project-managers
          3. Choose a role: Maintain
          4. Click Add senzing-project-managers
      2. For Organization Senzing:
        1. Click Add teams button.
          1. Using the appropriate development team based on the list: https://github.com/orgs/Senzing/teams
          2. Choose the team that will be used in .github/CODEOWNERS
          3. Choose a role: Write
          4. Click Add ... to this repository
      3. For Organizations senzing-factory| senzing-garage:
        1. Click Add teams button.
          1. Type senzing
          2. Choose the team that will be used in .github/CODEOWNERS
          3. Choose a role: Write
          4. Click Add ... to this repository

Code and security analysis

  1. On repository home page, click Settings tab.
    1. Click Code security tab.
      1. In Access to alerts:
        1. Search for the team that will be used in .github/CODEOWNERS and select.
        2. Click Save changes button

Link the project board

  1. On the repository home page, click Projects tab.
    1. Click Link a project
    2. Select the respective project board for the repository.
      1. Senzing organization: Senzing Github Organization Project
      2. senzing-factory organization: Factory
      3. senzing-garage organization, one of:
        1. App Server
        2. G2 Python
        3. Garage
        4. Garage Roadmap

Repository About

  1. On repository home page, click About gear
    1. Add Topic relative to which project board will be linked to the repository:
      1. senzing-app-server for Api Server / Web App
      2. senzing-github-organization-project for all Senzing organization repositories
      3. senzing-g2-python for G2Python projects
      4. senzing-garage for Garage projects
      5. senzing-devsecops for all senzing-factory organization projects
      6. senzing-unknown if not known
    2. Add optional Topics relative to code sub-project. Examples:
      1. golang - for "Go" based projects
    3. Click Save changes button

Initial content

  1. On repository home page, click Issues tab.
    1. Click New issue button.
    2. Select any type of issue and select Get started
      1. Title: Initial content
      2. Add a description: delete any default content in this text box.
      3. In the right side navigation select assign yourself.
      4. In the right side navigation select the respective project board.
      5. Click Submit new issue button.
  2. On repository home page, click Branch: main button.
    1. Create new branch. Example: 1-[your-name]-1 NOTE: Branch names should start with the respective issue number.

Populate repository with Community Artifacts

  1. On your workstation,

    1. ✏️ Substituting the organization for <ORG> and the new repository name for <REPO>,

      git clone [email protected]:<ORG>/<REPO>.git
      cd <REPO>
      git checkout 1-[your-name]-1
    2. Populate the new repository with the Community Artifacts found in github.com/senzing-garage/template-repository.

    3. Modify CONTRIBUTING.md

      1. export GIT_ACCOUNT=<ORG>
      2. export GIT_REPOSITORY=<new-repository-name>
    4. Modify .github/CODEOWNERS

    5. Modify .github/dependabot.yml

    6. Modify .project

    7. Modify ./docs/README.md

    8. Delete .github/workflows files that do not apply.

    9. Rename add-to-project-garage-dependabot.yaml and add-to-project-garage.yaml with the appropriate project name.

    10. Update the project variable and name of the workflow for the following:

      1. add-to-project-<project>-dependabot.yaml
      2. add-to-project-<project>.yaml
      3. move-pr-to-done-dependabot.yaml
    11. Commit the branch.

    12. Merge 1-[your-name]-1 branch into main branch.

Branch Protection

  1. On repository home page, click Settings tab.
  2. Click Branches tab.
  3. Edit main branch.
  4. Protect matching branches section
    1. ☑️ Require a pull request before merging
      1. ☑️ Require approvals
      2. ☑️ Require review from Code Owners
    2. ☑️ Require status checks to pass before merging.
      1. ☑️ Require branches to be up to date before merging.
        1. Search and add ALL required status checks for the respective repository.
          • Ex. type lint in the search bar and select lint-workflows / Lint Workflows and lint-workflows / changes. Both of these should be selected on ALL of our repositories. It is in the format <workfow-name>/<job-name>. Ignore any checks prefixed with -->.
          • TIPS:
            • Search for the job name of the respective workflow.
            • Jobs to be added must have been run within the past 7 days against the respective repository.
            • See GitHub docs for more details.
    3. ☑️ Require signed commits
    4. ☑️ Do not allow bypassing the above settings
    5. Click Save changes at the bottom of the page.

Pages

  1. On repository home page, click Settings tab.
    1. Click Pages tab.
      1. In Build and deployment section:
        1. Source: Deploy from a branch
        2. Branch
          1. Select branch: main
          2. Select folder: /docs
        3. Click Save button
      2. In Custom domain section:
        1. ☑️ Enforce HTTPS

Dependabot Automation Configuration

Additional settings changes required for auto merging dependabot pull requests. Requires Admin access.

Prerequsites

One time CODEOWNER token configuration.

Enable Auto Merge

  1. On repository home page, click Settings tab.
  2. In Pull Requests section
    1. 🔲 Allow merge commits
    2. ☑️ Allow squash merging
    3. ☑️ Allow rebase merging
    4. ☑️ Always suggest updating pull request branches
    5. ☑️ Allow auto-merge
    6. ☑️ Automatically delete head branches

Allow GitHub Actions to create and approve pull requests

  1. On repository home page, click Settings tab.
  2. In left side navigation bar, click Actions > General.
    1. ☑️ Allow GitHub Actions to create and approve pull requests
  3. Click Save button.

Add Dependabot Required Status Check

Perform the following steps after the dependabot actions have been performed. There will be no searchable items at the time of repository creation unless the status check has been performed within the last 7 day.

  1. On repository home page, click Settings tab.
  2. In left side navigation bar, select Branches tab.
  3. Select Edit for the main branch protection rule.
    1. Under Require branches to be up to date before merging, search for and select the required checks. Ex:
      • build-docker-container
      • dependabot-approve-and-merge / dependabot-approve-and-merge
      • Go 1.20 - darwin
      • Go 1.20 - linux
      • Go 1.20 - windows
      • gofmt / gofmt
      • gosec
    2. Click the matching search result in the drop down.
    3. Click Save changes at the bottom of the page.