2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-23 02:28:55 +00:00

32 Commits

Author SHA1 Message Date
Michal Nowak
96563c6020
Add a friendly Danger plea to run the pairwise CI job
Sometimes a pairwise definition for a new ./configure switch is added
but not tested in the CI.
2023-05-19 14:11:54 +02:00
Tom Krizek
79ae467973
danger: relax rules for single-line commits
The following are not also accepted as single-line commits without
generating warnings:
- CHANGES/release note may appear in the beginning of the commit message
- Release note may be capitalized
- Allow commits with "GL #" (e.g. Update documentation for [GL #XXXX])
2023-01-27 14:17:06 +01:00
Tom Krizek
1939e585c0
danger: update CHANGES rule to work with -S edition
When updating the -S edition, the CHANGES.SE file is modified. Make sure
danger accepts that.
2023-01-27 14:17:04 +01:00
Mark Andrews
9b12473292 Teach danger about amend
commit --fixup=amend:<hash> produces a subject starting with amend!
by default.  Have danger look for this to ensure that it is squashed
before merging.
2023-01-27 19:14:32 +11:00
Tom Krizek
64d71a1f5f
danger: check the Affects labels are set
Unless the MR is a backport, the Affects labels should be used to
indicate which versions are affected by the issue that prompted the MR.
2022-12-23 09:44:56 +01:00
Tom Krizek
d1172e011c
danger: check version in MR title
Enforce the version indicator to be at the start of the MR title.
2022-12-23 09:44:56 +01:00
Tom Krizek
e8a5ebaee5
danger: remove obsolete check for cherry pick msg
With proper backport commit detection, this check has been made
redundant.
2022-12-16 13:37:12 +01:00
Tom Krizek
c617f97784
danger: check backport commits for original commit IDs
A full backport must have all the commit from the original MR and the
original commit IDs must be referenced in the backport commit messages.

If the criteria above is not met, the MR should be marked as a partial
backport. In that case, any discrepencies are only logged as informative
messages rather than failures.
2022-12-16 13:37:12 +01:00
Tom Krizek
89530f1a1c
danger: check that original MR has been merged
When checking a backport MR, ensure that the original MR has been merged
already. This is vital for followup checks that verify commit IDs from
original commits are present in backport commit messages.
2022-12-16 13:37:12 +01:00
Tom Krizek
12e0b05738
danger: check backport links to the original MR
When doing archeology, it is much easier to find stuff if it's properly
linked. This check ensures that backport MR are linked to their original
MR via a "Backport of !XXXX" message.

The regular expression is fairly broad and has been tested to accept the
following variants of the message:
Backport of MR !XXXX
Backport of: !XXXX
backport of mr !XXXX
Backport of   !XXXX
Backport of https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/XXXX
2022-12-16 13:37:12 +01:00
Tom Krizek
14b027cf83
danger: ensure target branch is in the MR title
Having the MR title clearly marked in its title can be very useful when
looking through older issues/MRs.

This check also ensures that the version from the version label matches
the proper version branch (i.e. v9.16 must be marked with [v9_16]).
2022-12-16 13:37:11 +01:00
Tom Krizek
1c0c1ba8b9
danger: support partial backport label
Treat the Backport::Partial label as a backport as well.
2022-12-16 13:37:10 +01:00
Tom Krizek
5ecb277090
Check for cherry pick message in backport commits in danger CI
Using the -x option for cherry pick makes it easy to link commits across
branches and it is recommended to use for all backport commits (with
exceptions -- thus a warning level rather than failure).
2022-11-08 14:34:58 +01:00
Tom Krizek
402b11431c
Detect work-in-progress commits in danger CI
To avoid accidentally merging unfinished work, detect prohibited
keywords at the start of the subject line. If the first word is any of
the following, fail the check:
WIP, wip, DROP, drop, TODO, todo

The only slightly controversial is the lowercase "drop" which might have
a legitimate use - seems like four commits in the history used it as a
start of a sentence. However, since people commonly use "drop" to
indicate a commit should be dropped before merging, let's prohibit it as
well. In case of false-positive, "Drop" with a capitalized first letter
can always be used.
2022-11-08 14:34:58 +01:00
Tom Krizek
e901342dd9
Use approve button workflow in danger CI
Since the LGTM label was deprecated in favor of using the Approve button
in gitlab, adjust the detection in danger bot.

Unfortunately, danger-python seems no longer maintained since 2020 and
MR approvals aren't available in its Python API (even though they're
supported in its Ruby/JS APIs). Going forward, let's use the more
comprehensive python-gitlab API.

It still makes sense to utilize the danger-python, since it handles the
integration with gitlab which doesn't need to be reimplemented as long
as it works - same with the other checks.
2022-11-08 14:34:56 +01:00
Tom Krizek
c9cb8ae9eb
Auto-format Python files with black
This patch is strictly the result of:
$ black $(git ls-files '*.py')

There have been no manual changes.
2022-06-08 10:28:08 +02:00
Petr Špaček
b0f59cb5cb
Flag new user-visible log messages for review
Messages with log levels INFO or higher are flagged for manual review.
Purpose of this check is to prevent debug logs to being released with
too-high log level.
2022-06-03 12:09:41 +02:00
Ondřej Surý
58bd26b6cf Update the copyright information in all files in the repository
This commit converts the license handling to adhere to the REUSE
specification.  It specifically:

1. Adds used licnses to LICENSES/ directory

2. Add "isc" template for adding the copyright boilerplate

3. Changes all source files to include copyright and SPDX license
   header, this includes all the C sources, documentation, zone files,
   configuration files.  There are notes in the doc/dev/copyrights file
   on how to add correct headers to the new files.

4. Handle the rest that can't be modified via .reuse/dep5 file.  The
   binary (or otherwise unmodifiable) files could have license places
   next to them in <foo>.license file, but this would lead to cluttered
   repository and most of the files handled in the .reuse/dep5 file are
   system test files.
2022-01-11 09:05:02 +01:00
Michal Nowak
fe1dea6572 Update Danger check for GitLab references
Release notes now employ a custom :gl: Sphinx role for linking to GitLab
issues/MRs.  Tweak the relevant Danger checks to account for that.
2021-04-29 13:24:21 +02:00
Michał Kępień
bc42690c99 Skip subject line length check for merge commits
Some merge requests (e.g. those created for release branches) include
merge commits.  Prevent Danger from warning about excessive subject line
length for merge commits.  (While the proper way to detect a merge
commit would be to check the 'parents' attribute of a commit object,
Danger Python does not seem to populate that attribute, so a simple
string search is performed on the commit subject instead.)
2021-01-18 14:57:47 +01:00
Michał Kępień
09964e8085 Skip length check for lines containing references
The Danger GitLab CI job currently flags excessively long lines in
commit log messages.  Exclude lines containing references (i.e. starting
with "[1]", "[2]", etc.) from this check.  This allows e.g. long URLs to
be included in commit log messages without triggering Danger warnings.
2021-01-18 14:57:47 +01:00
Michał Kępień
801d13f62f Only warn about fixup commits once per run
The Danger GitLab CI job currently generates a separate error message
about fixup commits being present in a merge request for every such
commit found.  Prevent that by making it only log that error message
once per run.
2021-01-18 14:57:47 +01:00
Michał Kępień
953c810f41 Flag trailing dots in commit subject lines
Make the Danger GitLab CI job fail when the subject line for any commit
belonging to a merge request contains a trailing dot.
2021-01-18 14:57:47 +01:00
Michał Kępień
ff58ec8cef Flag missing pairwise testing markers
Make the Danger GitLab CI job fail when a merge request adds a new
./configure switch without also adding a "# [pairwise: ...]" marker that
the relevant GitLab CI job uses for preparing the pairwise testing
model.  This helps to ensure that any newly added ./configure switches
are tested by the pairwise testing GitLab CI job.
2021-01-18 14:57:47 +01:00
Michał Kępień
d81ad454cc Suggest adding release notes for customer issues
Make Danger suggest adding a release note to a merge request if the
latter is marked with the "Customer" label but not with the "Release
Notes" label.
2021-01-18 14:57:47 +01:00
Michał Kępień
2f77c7680a Handle [placeholder] CHANGES entries
Make the Danger GitLab CI job fail when a merge request targeting a
branch different than "main" adds any [placeholder] entries to the
CHANGES file.  Prevent Danger from flagging missing GitLab identifiers
for [placeholder] CHANGES entries.
2021-01-18 14:57:47 +01:00
Michał Kępień
97364f5518 Flag missing CVE identifiers
Make Danger ensure that if a merge request fixes a security issue then
that merge request includes a CHANGES entry and a release note, both of
which contain a CVE identifier.
2021-01-18 14:57:47 +01:00
Evan Hunt
dcee985b7f update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
Michał Kępień
e062812c38 Prevent invalid warnings about missing identifiers
The Danger script inspects differences between the current version of a
given merge request's target branch and the merge request branch.  If
the latter falls behind the former, the Danger script will wrongly warn
about missing GitLab/RT identifiers because it incorrectly treats the
"+++" diff marker as an indication of the merge request adding new lines
to a file.  Tweak the relevant conditional expression to prevent such
invalid warnings from being raised.
2020-06-03 15:45:28 +02:00
Michał Kępień
d558c4cb78 Make fetching target branch reliable
As GitLab Runner Docker executor caches Git repositories between jobs,
prevent the Danger script from attempting to update local refs to ensure
"git fetch" returns with an exit code of 0.  Use the FETCH_HEAD ref for
determining the differences between the merge request branch and its
target branch.
2020-06-03 15:45:28 +02:00
Michał Kępień
c13944ca46 Tweak condition for missing log message warning
Commits adding CHANGES entries and/or release notes do not need a commit
log message.  Do not warn about a missing commit log message for such
commits to make the warning more meaningful.
2020-06-03 15:45:28 +02:00
Michał Kępień
36bb45a8b6 Add Danger Python to GitLab CI
Certain rules of the BIND development process are not codified anywhere
and/or are used inconsistently.  In an attempt to improve this
situation, add a GitLab CI job which uses Danger Python to add comments
to merge requests when certain expectations are not met.  Two categories
of feedback are used, only one of which - fail() - causes the GitLab CI
job to fail.  Exclude dangerfile.py from Python QA checks as the way the
contents of that file are evaluated triggers a lot of Flake8 and PyLint
warnings.
2020-06-01 11:13:31 +00:00