Skip to content
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

senzing-factory/build-resources#69 add linting #104

Merged
merged 13 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/linters/.markdown-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"line-length": false
}
17 changes: 17 additions & 0 deletions .github/linters/.python-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[pylint]
disable=
broad-except,
broad-exception-raised,
consider-using-f-string,
import-error,
line-too-long,
too-many-arguments,
too-many-branches,
too-many-lines,
too-many-locals,
too-many-return-statements,
too-many-statements,
good-names=
github-util
ignore=
__init__.py,
7 changes: 4 additions & 3 deletions .github/workflows/add-labels-standardized.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
name: 'add labels standardized'
name: add labels standardized

on:
issues:
types:
- opened
- reopened

permissions:
issues: write

jobs:
add-issue-labels:
permissions:
issues: write
secrets:
ORG_MEMBERSHIP_TOKEN: ${{ secrets.ORG_MEMBERSHIP_TOKEN }}
SENZING_MEMBERS: ${{ secrets.SENZING_MEMBERS }}
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/add-to-project-factory-dependabot.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
name: 'add to project factory dependabot'
name: add to project factory dependabot

on:
pull_request:
branches: [main]

jobs:
permissions:
repository-projects: write

add-issue-labels:
jobs:
add-to-project-dependabot:
secrets:
SENZING_GITHUB_PROJECT_RW_TOKEN: ${{ secrets.SENZING_GITHUB_PROJECT_RW_TOKEN }}
uses: senzing-factory/build-resources/.github/workflows/add-to-project-dependabot.yaml@main
uses: senzing-factory/build-resources/.github/workflows/add-to-project-dependabot.yaml@v1
with:
project: ${{ vars.SENZING_PROJECT_FACTORY }}
12 changes: 8 additions & 4 deletions .github/workflows/add-to-project-factory.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
name: 'add to project factory'
name: add to project factory

on:
issues:
types:
- opened
- reopened

permissions:
repository-projects: write

jobs:
add-to-project:
name: Add issue to project
name: add issue to project
runs-on: ubuntu-latest

steps:
- name: Assign issue to project
- name: assign issue to project
uses: actions/add-to-project@v0.5.0
with:
project-url: https://github.com/orgs/${{ vars.SENZING_GITHUB_ACCOUNT_NAME }}/projects/${{ vars.SENZING_PROJECT_FACTORY }}
github-token: ${{ secrets.SENZING_GITHUB_ACCESS_TOKEN }}
project-url: https://github.com/orgs/${{ vars.SENZING_GITHUB_ACCOUNT_NAME }}/projects/${{ vars.SENZING_PROJECT_FACTORY }}
18 changes: 18 additions & 0 deletions .github/workflows/lint-repo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: lint repo

on:
push:
branches-ignore: [main]
pull_request:
branches: [main]

permissions:
contents: read
packages: read
statuses: write

jobs:
lint-code-base:
uses: senzing-factory/build-resources/.github/workflows/linter.yaml@main
with:
validate-all-codebase: true
17 changes: 17 additions & 0 deletions .github/workflows/move-pr-to-done-dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: move pr to done dependabot

on:
pull_request:
branches: [main]
types: [closed]

permissions:
repository-projects: write

jobs:
move-pr-to-done-dependabot:
secrets:
SENZING_GITHUB_PROJECT_RW_TOKEN: ${{ secrets.SENZING_GITHUB_PROJECT_RW_TOKEN }}
uses: senzing-factory/build-resources/.github/workflows/move-pr-to-done-dependabot.yaml@v1
with:
project: ${{ vars.SENZING_PROJECT_FACTORY }}
23 changes: 0 additions & 23 deletions .github/workflows/pylint.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ Project maintainers have the right and responsibility to remove, edit, or reject

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project email address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at support@senzing.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at `support@senzing.com`. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

Expand Down
1 change: 0 additions & 1 deletion docs/versioned-releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
1. [ ] [xterm](https://github.com/Senzing/docker-xterm)
1. [ ] [resolver](https://github.com/Senzing/resolver)


### Phase 3 - lower priority

1. [ ] [g2configtool](https://github.com/Senzing/g2configtool)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
export GITHUB_ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```

## identify-customer.sh
## add-labels-standardized.sh

1. Run `update-git-action-add-triage-label.sh`.
1. Run `add-labels-standardized.sh`.
Example:

```console
cd ${GIT_REPOSITORY_DIR}/examples/identify-customer
./identify-customer.sh
cd ${GIT_REPOSITORY_DIR}/examples/add-labels-standardized
./add-labels-standardized.sh
```
72 changes: 72 additions & 0 deletions examples/add-labels-standardized/add-labels-standardized.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/usr/bin/env bash

# -----------------------------------------------------------------------------
# User modifications
# -----------------------------------------------------------------------------

# Internal parameters.

GITHUB_UTIL_DIR=~/senzing.git/github-util
GIT_REPOSITORY_DIR=~/senzing-test.git
GIT_MESSAGE="Add add-labels-standardized.yaml"
ACTION_SOURCE_FILE=~/senzing.git/github-util/examples/add-labels-standardized/add-labels-standardized.yaml

# -----------------------------------------------------------------------------
# Main
# -----------------------------------------------------------------------------

# Verify parameters.

if [ -z ${GITHUB_ACCESS_TOKEN+x} ]; then
echo "GITHUB_ACCESS_TOKEN is not set."
exit
fi

# Make the directory to clone repositories into.

mkdir -p ${GIT_REPOSITORY_DIR}

# Process each submodule.

REPOSITORIES=$(${GITHUB_UTIL_DIR}/github-util.py print-repository-names)
for REPOSITORY in "${REPOSITORIES[@]}"; do
echo "---- ${REPOSITORY} ------------------------------------------"

DESTINATION_DIR=${GIT_REPOSITORY_DIR}/${REPOSITORY}/.github/workflows

# Clone repository.

cd ${GIT_REPOSITORY_DIR} || {
echo "[ERROR] Failed to change directory"
exit 1
}
git clone "git@github.com:Senzing/${REPOSITORY}.git"

# Make repository directory the current working directory.

cd ${GIT_REPOSITORY_DIR}/"${REPOSITORY}" || {
echo "[ERROR] Failed to change directory"
exit 1
}

# Checkout current main/main branch.

git checkout main
git checkout main
git pull

# Manipulate the files in the repository.

mkdir -p "${DESTINATION_DIR}"
cp ${ACTION_SOURCE_FILE} "${DESTINATION_DIR}"

# Add and commit all changes to local git repository.

git add --all
git commit -a -m "${GIT_MESSAGE}"

# Push changes to GitHub

git push

done
16 changes: 16 additions & 0 deletions examples/add-labels-standardized/add-labels-standardized.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: add labels standardized

on:
issues:
types:
- opened
- reopened

jobs:
add-issue-labels:
permissions:
issues: write
secrets:
ORG_MEMBERSHIP_TOKEN: ${{ secrets.ORG_MEMBERSHIP_TOKEN }}
SENZING_MEMBERS: ${{ secrets.SENZING_MEMBERS }}
uses: senzing-factory/build-resources/.github/workflows/add-labels-to-issue.yaml@v1
24 changes: 12 additions & 12 deletions examples/add-to-project/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,50 +22,50 @@

## add-to-project.sh

1. Run `add-to-project.sh` for `t-ast`.
1. Run `add-to-project.sh` for `senzing-app-server`.
Example:

```console
cd ${GIT_REPOSITORY_DIR}/examples/add-to-project

export SENZING_TOPICS_INCLUDED=t-ast
export ACTION_SOURCE_FILE=~/senzing.git/github-util/examples/add-to-project/add-to-project-t-ast.yaml
export SENZING_TOPICS_INCLUDED=senzing-app-server
export ACTION_SOURCE_FILE=~/senzing.git/github-util/examples/add-to-project/add-to-project-app-server.yaml

./add-to-project.sh
```

1. Run `add-to-project.sh` for `t-comm`.
1. Run `add-to-project.sh` for `senzing-community`.
Example:

```console
cd ${GIT_REPOSITORY_DIR}/examples/add-to-project

export SENZING_TOPICS_INCLUDED=t-comm
export ACTION_SOURCE_FILE=~/senzing.git/github-util/examples/add-to-project/add-to-project-t-comm.yaml
export SENZING_TOPICS_INCLUDED=senzing-community
export ACTION_SOURCE_FILE=~/senzing.git/github-util/examples/add-to-project/add-to-project-community.yaml

./add-to-project.sh
```

1. Run `add-to-project.sh` for `t-g2-python`.
1. Run `add-to-project.sh` for `senzing-g2-python`.
Example:

```console
cd ${GIT_REPOSITORY_DIR}/examples/add-to-project

export SENZING_TOPICS_INCLUDED=t-g2-python
export ACTION_SOURCE_FILE=~/senzing.git/github-util/examples/add-to-project/add-to-project-t-g2-python.yaml
export SENZING_TOPICS_INCLUDED=senzing-g2-python
export ACTION_SOURCE_FILE=~/senzing.git/github-util/examples/add-to-project/add-to-project-g2-python.yaml

./add-to-project.sh
```

1. Run `add-to-project.sh` for `t-gdev`.
1. Run `add-to-project.sh` for `senzing-gdev`.
Example:

```console
cd ${GIT_REPOSITORY_DIR}/examples/add-to-project

export SENZING_TOPICS_INCLUDED=t-gdev
export ACTION_SOURCE_FILE=~/senzing.git/github-util/examples/add-to-project/add-to-project-t-gdev.yaml
export SENZING_TOPICS_INCLUDED=senzing-gdev
export ACTION_SOURCE_FILE=~/senzing.git/github-util/examples/add-to-project/add-to-project-gdev.yaml

./add-to-project.sh
```
19 changes: 19 additions & 0 deletions examples/add-to-project/add-to-project-app-server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: add to project app server

on:
issues:
types:
- opened
- reopened

jobs:
add-to-project:
name: add issue to project
runs-on: ubuntu-latest

steps:
- name: assign issue to project
uses: actions/add-to-project@v0.5.0
with:
github-token: ${{ secrets.SENZING_GITHUB_ACCESS_TOKEN }}
project-url: https://github.com/orgs/${{ vars.SENZING_GITHUB_ACCOUNT_NAME }}/projects/${{ vars.SENZING_PROJECT_APP_SERVER }}
21 changes: 21 additions & 0 deletions examples/add-to-project/add-to-project-community.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: add to project community

on:
issues:
types:
- opened
- reopened

jobs:
add-to-project:
name: add issue to project
runs-on: ubuntu-latest

steps:
- name: assign issue to project
env:
GITHUB_TOKEN: ${{ secrets.SENZING_GITHUB_ACCESS_TOKEN }}
uses: senzing-factory/github-action-add-issue-to-project@v1
with:
project: "https://github.com/orgs/Senzing/projects/${{ vars.SENZING_PROJECT_COMMUNITY }}"
column_name: "Backlog"
Loading