Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
0879865
Create dataplane-checks.yml
pjaitken Apr 26, 2021
fc3f571
Update dataplane-checks.yml
pjaitken Apr 26, 2021
6bf983d
Update dataplane-checks.yml
pjaitken Apr 26, 2021
e87edd1
Update dataplane-checks.yml
pjaitken Apr 26, 2021
4e818e6
Update dataplane-checks.yml
pjaitken Apr 26, 2021
eadf6e8
Update dataplane-checks.yml
pjaitken Apr 26, 2021
3df4b42
Update dataplane-checks.yml
pjaitken Apr 26, 2021
f5802d0
Update dataplane-checks.yml
pjaitken Apr 26, 2021
41231de
Update dataplane-checks.yml
pjaitken Apr 26, 2021
18bbd6b
Update dataplane-checks.yml
pjaitken Apr 26, 2021
190197e
Update dataplane-checks.yml
pjaitken Apr 26, 2021
22dea5d
Update dataplane-checks.yml
pjaitken Apr 26, 2021
a938a11
Update dataplane-checks.yml
pjaitken Apr 26, 2021
c1ff234
Update dataplane-checks.yml
pjaitken Apr 26, 2021
73ddb71
Update dpi.c
pjaitken Apr 26, 2021
47d17cb
Update dataplane-checks.yml
pjaitken Apr 26, 2021
0317f2e
gitlint
pjaitken Apr 27, 2021
e58aa5b
Update gitlint.yaml
pjaitken Apr 27, 2021
edd4802
Update dataplane-checks.yml
pjaitken Apr 27, 2021
ae28b8c
Update gitlint.yaml
pjaitken Apr 27, 2021
44cef97
Update gitlint.yaml
pjaitken Apr 27, 2021
455373f
Update gitlint.yaml
pjaitken Apr 27, 2021
d589ffc
Update dataplane-checks.yml
pjaitken Apr 27, 2021
763a903
Create JR-gitlint
pjaitken Apr 27, 2021
9996168
Update JR-gitlint
pjaitken Apr 27, 2021
8abe102
Update JR-gitlint
pjaitken Apr 27, 2021
3a4ba81
Update and rename JR-gitlint to JR-gitlint.yml
pjaitken Apr 27, 2021
323b94d
Rename JR-gitlint.yml to jrgitlint.yml
pjaitken Apr 27, 2021
71dd1fb
Update jrgitlint.yml
pjaitken Apr 27, 2021
d971993
Update jrgitlint.yml
pjaitken Apr 27, 2021
875f29e
Update jrgitlint.yml
pjaitken Apr 27, 2021
2a3c2e6
Update jrgitlint.yml
pjaitken Apr 27, 2021
47b25fb
Update jrgitlint.yml
pjaitken Apr 27, 2021
04f9792
Update jrgitlint.yml
pjaitken Apr 27, 2021
831edcb
Update jrgitlint.yml
pjaitken Apr 27, 2021
63ee2bc
Update jrgitlint.yml
pjaitken Apr 27, 2021
5dd3e7c
Update jrgitlint.yml
pjaitken Apr 27, 2021
29b98ec
Update jrgitlint.yml
pjaitken Apr 27, 2021
be7ef58
Update jrgitlint.yml
pjaitken Apr 27, 2021
7f14181
Update jrgitlint.yml
pjaitken Apr 27, 2021
3cf5dad
Update jrgitlint.yml
pjaitken Apr 27, 2021
ca2c82d
Update jrgitlint.yml
pjaitken Apr 27, 2021
ea9fc2e
Create checkpatch2.yml
pjaitken Apr 28, 2021
8c20fe3
Update checkpatch2.yml
pjaitken Apr 28, 2021
3c7fcbb
Update checkpatch2.yml
pjaitken Apr 28, 2021
6c4026f
Update checkpatch2.yml
pjaitken Apr 28, 2021
1a2aa44
Rename dataplane-checks.yml to checkpatch.yml
pjaitken Apr 28, 2021
431b19c
Update jrgitlint.yml
pjaitken Apr 28, 2021
379ae07
Update jrgitlint.yml
pjaitken Apr 28, 2021
8ba54ea
Update jrgitlint.yml
pjaitken Apr 28, 2021
f0be3ff
Update jrgitlint.yml
pjaitken Apr 28, 2021
ed048aa
Update jrgitlint.yml
pjaitken Apr 28, 2021
840dca6
Update jrgitlint.yml
pjaitken Apr 28, 2021
f8233d9
Update jrgitlint.yml
pjaitken Apr 28, 2021
365bb4b
Update jrgitlint.yml
pjaitken Apr 28, 2021
fde3306
Update jrgitlint.yml
pjaitken Apr 28, 2021
c4a4dac
Update jrgitlint.yml
pjaitken Apr 28, 2021
167b561
Update jrgitlint.yml
pjaitken Apr 28, 2021
5b59ab6
Update jrgitlint.yml
pjaitken Apr 28, 2021
f5fabe9
Update jrgitlint.yml
pjaitken Apr 28, 2021
20b441d
Update jrgitlint.yml
pjaitken Apr 28, 2021
51619c8
Update jrgitlint.yml
pjaitken Apr 28, 2021
daa954b
Update jrgitlint.yml
pjaitken Apr 28, 2021
544d7fd
Update jrgitlint.yml
pjaitken Apr 28, 2021
1a64718
Update jrgitlint.yml
pjaitken Apr 28, 2021
6a291b8
Update jrgitlint.yml
pjaitken Apr 28, 2021
a097f1c
Update jrgitlint.yml
pjaitken Apr 28, 2021
a3c7a69
Update jrgitlint.yml
pjaitken Apr 28, 2021
1f80154
Update jrgitlint.yml
pjaitken Apr 28, 2021
2d44cf1
Update jrgitlint.yml
pjaitken Apr 28, 2021
aa4b947
Update jrgitlint.yml
pjaitken Apr 28, 2021
8fc9607
Create gitlint0.yml
pjaitken Apr 29, 2021
ce56977
Update gitlint0.yml
pjaitken Apr 29, 2021
5cb7819
Update gitlint0.yml
pjaitken Apr 29, 2021
6e4e134
Update checkpatch2.yml
pjaitken Apr 29, 2021
048bb57
Update checkpatch2.yml
pjaitken Apr 29, 2021
75b46c4
Update checkpatch2.yml
pjaitken Apr 29, 2021
75b80cf
Update checkpatch2.yml
pjaitken Apr 29, 2021
cf7fc41
Update checkpatch2.yml
pjaitken Apr 29, 2021
076403a
Update checkpatch2.yml
pjaitken Apr 29, 2021
7a44df8
Update checkpatch2.yml
pjaitken Apr 29, 2021
718387b
Update checkpatch2.yml
pjaitken Apr 29, 2021
0a7afba
Update checkpatch2.yml
pjaitken Apr 29, 2021
3458cc0
Update checkpatch2.yml
pjaitken Apr 29, 2021
5471161
Update checkpatch2.yml
pjaitken Apr 29, 2021
2f3cf3f
Update checkpatch2.yml
pjaitken Apr 29, 2021
992e3a1
Create commit_size_check.sh
pjaitken Apr 29, 2021
47e39bd
Create commit_size_check.yml
pjaitken Apr 29, 2021
fdb7e53
Update commit_size_check.yml
pjaitken Apr 29, 2021
6acfdc3
add +x
pjaitken Apr 29, 2021
1b00189
Update commit_size_check.yml
pjaitken Apr 29, 2021
60135fb
Update commit_size_check.yml
pjaitken Apr 30, 2021
7329389
Update commit_size_check.yml
pjaitken Apr 30, 2021
bec0c78
Update commit_size_check.yml
pjaitken Apr 30, 2021
e300f75
Update commit_size_check.yml
pjaitken Apr 30, 2021
929e1ee
Update commit_size_check.yml
pjaitken Apr 30, 2021
fa17335
Update commit_size_check.yml
pjaitken Apr 30, 2021
22d66d0
Update commit_size_check.yml
pjaitken Apr 30, 2021
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
16 changes: 16 additions & 0 deletions .github/workflows/checkpatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Run checkpatch on pull requests.
# See https://github.com/webispy/checkpatch-action

name: checkpatch

on: pull_request

jobs:
checkpatch:
name: checkpatch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Run checkpatch review
uses: webispy/checkpatch-action@master
- run: echo "Job status is ${{ job.status }}."
42 changes: 42 additions & 0 deletions .github/workflows/checkpatch2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: checkpatch2

on: pull_request

jobs:
checkpatch:

runs-on: ubuntu-latest

# container:
# image: webispy/checkpatch

steps:
- uses: actions/checkout@v2

- name: pwd
run: pwd

- name: git fetch
run: git fetch --no-tags --prune origin +refs/heads/*:refs/remotes/origin/*

- name: show
run: |
echo "GITHUB_BASE_REF=${GITHUB_BASE_REF}"
echo "GITHUB_HEAD_REF=${GITHUB_HEAD_REF}"
echo "PATH=${PATH}"
which checkpatch.pl
# find / -name checkpatch.pl
# ls -l /usr/bin/checkpatch.pl
# /usr/bin/checkpatch.pl -h
# checkpatch.pl


# - name: Run DPDK checkpatches.sh review
# uses: webispy/checkpatch-action@master
# env:
# DPDK_CHECKPATCH_PATH: /usr/bin/checkpatch.pl
# CHECKPATCH_COMMAND: ./scripts/checkpatch_wrapper.sh origin/${GITHUB_BASE_REF} origin/${GITHUB_HEAD_REF}

- name: run checkpatch
run: ./scripts/checkpatch_wrapper.sh origin/${GITHUB_BASE_REF} origin/${GITHUB_HEAD_REF}
- run: echo "Job status is ${{ job.status }}."
30 changes: 30 additions & 0 deletions .github/workflows/commit_size_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Run size check on pull requests.

name: size check

on: pull_request

jobs:
size_check:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: install
run: sudo apt-get install git-buildpackage osc debhelper

- name: which
run: which gbp osc dh

- name: git fetch
run: git fetch --no-tags --prune origin +refs/heads/*:refs/remotes/origin/*

- name: gbp
run: pwd && gbp buildpackage --git-verbose --git-ignore-branch -S --no-check-builddeps -us -uc

- name: run size check
run: ./scripts/commit_size_check.sh origin/${GITHUB_BASE_REF} origin/${GITHUB_HEAD_REF}

- run: echo "Job status is ${{ job.status }}."
21 changes: 21 additions & 0 deletions .github/workflows/gitlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Run gitlint on pull requests.
# See https://github.com/marketplace/actions/gitlint-action

name: GitLint

on: pull_request

jobs:
gitlint:
name: GitLint
runs-on: ubuntu-latest
steps:
- name: Lint commits, branches, and pull requests
uses: aschbacd/gitlint-action@v1.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
commit-message-body-max-length: 72
commit-message-subject-max-length: 50
prohibit-unknown-commit-authors: true
prohibit-unknown-commit-committers: true
- run: echo "Job status is ${{ job.status }}."
29 changes: 29 additions & 0 deletions .github/workflows/gitlint0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Run gitlint on pull requests.

name: gitlint0

on: pull_request

jobs:
gitlint:

runs-on: ubuntu-latest

container:
image: jorisroovers/gitlint

steps:
- uses: actions/checkout@v2
- name: git fetch
run: git fetch --no-tags --prune origin +refs/heads/*:refs/remotes/origin/*
- name: echo
run: |
echo "GITHUB_HEAD_REF=${GITHUB_HEAD_REF}"
echo "GITHUB_BASE_REF=${GITHUB_BASE_REF}"
- name: head
run: git log origin/${GITHUB_HEAD_REF}
- name: base
run: git log origin/${GITHUB_BASE_REF}
- name: run gitlint
run: gitlint --commits origin/${GITHUB_BASE_REF}..origin/${GITHUB_HEAD_REF}
- run: echo "Job status is ${{ job.status }}."
44 changes: 44 additions & 0 deletions .github/workflows/jrgitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: JR GitLint

on: [push, pull_request, workflow_dispatch]

jobs:
gitlint:

runs-on: ubuntu-latest

container:
image: jorisroovers/gitlint

steps:
- uses: actions/checkout@v2
- name: git fetch
run: git fetch --no-tags --prune origin +refs/heads/*:refs/remotes/origin/*
- name: git show
run: |
echo "GITHUB_HEAD_REF=${GITHUB_HEAD_REF}"
echo "GITHUB_BASE_REF=${GITHUB_BASE_REF}"
echo "github.event.pull_request.head.ref=${{ github.event.pull_request.head.ref }}"
echo "github.event.pull_request.base.ref=${{ github.event.pull_request.base.ref }}"
echo "github.event.pull_request.head.sha=${{ github.event.pull_request.head.sha }}"
echo "github.event.pull_request.base.sha=${{ github.event.pull_request.base.sha }}"
# - name: git show H
# run: git show ${{ github.event.pull_request.head.sha }}
# run: git show ${{ GITHUB_HEAD_REF }}
# - name: git show B
# run: git show ${{ github.event.pull_request.head.sha }}
# run: git show ${{ GITHUB_BASE_REF }}
- name: git log 1
run: git log --pretty=oneline ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
- name: git log 2
run: git log --pretty=oneline origin/${GITHUB_BASE_REF}..origin/${GITHUB_HEAD_REF}
- name: run gitlint 1
run: gitlint --commits ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
- name: run gitlint 2
run: gitlint --commits origin/${GITHUB_BASE_REF}..origin/${GITHUB_HEAD_REF}
# run: gitlint --commits origin/${GITHUB_BASE_REF}..origin/${GITHUB_HEAD_REF}
- run: echo "Job status is ${{ job.status }}."

# run: gitlint --commits origin/${GITHUB_BASE_REF}..origin/${GITHUB_HEAD_REF}
# run: git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
# run: git log --abbrev-commit ${GITHUB_BASE_REF}..${GITHUB_HEAD_REF}
51 changes: 51 additions & 0 deletions scripts/commit_size_check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#! /bin/bash

# Copyright (c) 2021, AT&T Intellectual Property. All rights reserved.

usage () {
echo "Usage: $(basename $0) target source" >&2
echo "target: something like 'origin/master'" >&2
echo "source: something like 'bugfix/foo' or 'feature/bar'" >&2
}

[ "$#" -ne 2 ] && { usage; exit 1; }

TARGET="$1" # most likely "origin/master"
SOURCE="$2" # most likely "bugfix/foo" or "feature/bar"

MAX_CHANGED_LINES_ALLOWED=400

GIT_SOURCE_HASH=$(git rev-list -n1 "$SOURCE")
GIT_TARGET_HASH=$(git rev-list -n1 "$TARGET")
GIT_MERGE_BASE=$(git merge-base $GIT_SOURCE_HASH $GIT_TARGET_HASH)

ALL_COMMITS=$(git rev-list --no-merges \
"$GIT_MERGE_BASE..$GIT_SOURCE_HASH")
for COMMIT in $ALL_COMMITS
do
COMMIT_CHANGES=$(git show --format=format:'' --shortstat "$COMMIT")

REGEX_INSERTIONS=".* ([0-9]+) insertions.*"
[[ "$COMMIT_CHANGES" =~ $REGEX_INSERTIONS ]]
INSERTIONS="${BASH_REMATCH[1]}"

REGEX_DELETIONS=".* ([0-9]+) deletions.*"
[[ "$COMMIT_CHANGES" =~ $REGEX_DELETIONS ]]
DELETIONS="${BASH_REMATCH[1]}"

TOTAL_CHANGE=$(( INSERTIONS + DELETIONS ))

#echo "$COMMIT $COMMIT_CHANGES"
#echo "Insertions:$INSERTIONS Deletions:$DELETIONS"
#echo "Total Change:$TOTAL_CHANGE"

if [ "$TOTAL_CHANGE" -gt "$MAX_CHANGED_LINES_ALLOWED" ]; then
echo "$COMMIT is greater than $MAX_CHANGED_LINES_ALLOWED lines,"\
"please consider splitting into multiple commits."
COMMIT_TOO_LARGE=true
fi
done

if [ "$COMMIT_TOO_LARGE" = "true" ]; then
exit 1
fi
2 changes: 2 additions & 0 deletions src/npf/dpi/dpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* SPDX-License-Identifier: LGPL-2.1-only
*/

// blah blah blah, this line will be too long and checkpatch will complain about it.

#include <errno.h>
#include <stdbool.h>
#include <string.h>
Expand Down