Commit Graph

73 Commits

Author SHA1 Message Date
None
3e06c882f0 .github: remove pull_request_template
The reason for the pr template is to explain why do we need to backport
a PR.

On release branches there is no need for it

Closes scylladb/scylladb#19615
2024-07-04 16:52:27 +03:00
Yaron Kaikov
1577765a20 .github/scripts/label_promoted_commits.py: fix adding labels when PR is closed
`prs = response.json().get("items", [])` will return empty when there are no merged PRs, and this will just skip the all-label replacement process.

This is a regression following the work done in #19442

Adding another part to handle closed PRs (which is the majority of the cases we have in Scylla core)

Fixes: https://github.com/scylladb/scylladb/issues/19441
(cherry picked from commit 2eb8344b9a)

Closes scylladb/scylladb#19527
2024-06-27 19:35:18 +03:00
Yaron Kaikov
9f31426ead .github/workflow: close and replace label when backport promoted
Today after Mergify opened a Backport PR, it will stay open until someone manually close the backport PR , also we can't track using labels which backport was done or not since there is no indication for that except digging into the PR and looking for a comment or a commit ref

The following changes were made in this PR:
* trigger add-label-when-promoted.yaml also when the push was made to `branch-x.y`
* Replace label `backport/x.y` with `backport/x.y-done` in the original PR (this will automatically update the original Issue as well)
* Add a comment on the backport PR and close it

Fixes: https://github.com/scylladb/scylladb/issues/19441
(cherry picked from commit 394cba3e4b)

Closes scylladb/scylladb#19496
2024-06-26 12:42:34 +03:00
Yaron Kaikov
bc596a3e76 pull_request_template: clearify the template and remove checkbox verification
It seems that having the checkbox in the PR template and failing the action is confusing and not very clear. Let's remove it completely and just add to the template an explanation to explain the backport reason

Closes scylladb/scylladb#18708
2024-05-20 18:24:28 +03:00
Kefu Chai
02be1e9309 .github: add clang-tidy workflow
clang-tidy is a tool provided by Clang to perform static analysis on
C++ source files. here, we are mostly intersted in using its
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/use-after-move.html
check to reveal the potential issues.

this workflow is added to run clang-tidy when building the tree, so
that the warnings from clang-tidy can be noticed by developers.

a dedicated action is added so other github workflow can reuse it to
setup the building environment in an ubuntu:jammy runner.

clang-tidy-matcher.json is added to annotate the change, so that the
warnings are more visible with github webpage.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes scylladb/scylladb#18342
2024-05-09 08:26:43 +03:00
Yaron Kaikov
5e63f74984 [github] add action to verify PR tasks was completed
Adding another check to the PR summary will make it clear to the maintainer/reviewer if the developer explained about backport
2024-04-25 15:24:22 +03:00
Yaron Kaikov
44d1ffe86b [github] add PR template
Today with the backport automation, the developer added the relevant backport label, but without any explanation of why

Adding the PR template with a placeholder for the developer to add his decision about backport yes or no

The placeholder is marked as a task, so once the explanation is added, the task must be checked as completed
2024-04-17 15:40:32 +03:00
David Garcia
6707bc673c docs: update theme 1.7
Closes scylladb/scylladb#18252
2024-04-16 13:48:11 +02:00
Yaron Kaikov
fcdb80773e github: sync-labels: run only in scylladb oss repo
We currently support the sync-label only in OSS. Since Scylla-enterprise
get all the commits from OSS repo, the sync-label is running and failing
during checkout (since it's a private repo and should have different
configuration)

For now, let's limit the workflows for oss repo

Closes scylladb/scylladb#18142
2024-04-02 10:45:17 +03:00
Kefu Chai
c5601a749e github: sync_labels: do not error out if PR's cover letter is empty
if a pull request's cover letter is empty, `pr.body` is None. in that
case we should not try to pass it to `re.findall()` as the "string"
parameter. otherwise, we'd get

```
TypeError: expected string or bytes-like object, got 'NoneType'
```
so, in this change, we just return an empty list if the PR in question
has an empty cover letter.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes scylladb/scylladb#18125
2024-04-01 18:13:22 +03:00
Kefu Chai
07c40f5600 github: sync_labels: use ${{}} expression syntax in "if" condition
to ensure that the expression is evaluated properly.
see https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsif

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes scylladb/scylladb#18127
2024-04-01 17:17:43 +03:00
Kefu Chai
1494499f90 github: sync_labels: checkout a single file not the whole repo
what we need is but a script, so instead of checkout the whole repo,
with all history for all tags and branches, let's just checkout
a single file. faster this way.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes scylladb/scylladb#18126
2024-04-01 17:15:50 +03:00
Yaron Kaikov
b8c705bc54 .github: sync-labels: fix pull request permissions
when adding a label to a PR request we keep getting the following error
message:
```
Traceback (most recent call last):
  File "/home/runner/work/scylladb/scylladb/.github/scripts/sync_labels.py", line 93, in <module>
    main()
  File "/home/runner/work/scylladb/scylladb/.github/scripts/sync_labels.py", line 89, in main
    sync_labels(repo, args.number, args.label, args.action, args.is_issue)
  File "/home/runner/work/scylladb/scylladb/.github/scripts/sync_labels.py", line 74, in sync_labels
    target.add_to_labels(label)
  File "/usr/lib/python3/dist-packages/github/Issue.py", line 321, in add_to_labels
    headers, data = self._requester.requestJsonAndCheck(
  File "/usr/lib/python3/dist-packages/github/Requester.py", line 353, in requestJsonAndCheck
    return self.__check(
  File "/usr/lib/python3/dist-packages/github/Requester.py", line 378, in __check
    raise self.__createException(status, responseHeaders, output)
github.GithubException.GithubException: 403 {"message": "Resource not accessible by integration", "documentation_url": "https://docs.github.com/rest/issues/labels#add-labels-to-an-issue"}
```

Based on
https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token.
The maximum access for pull requests from public forked repositories is
set to `read`

Switching to `pull_request_target` to solve it

Fixes: https://github.com/scylladb/scylladb/issues/18102

Closes scylladb/scylladb#18052
2024-04-01 17:11:35 +03:00
Beni Peled
eecfd164ff Remove docs-amplify-enhanced github-workflow
Since we implemented the CI-Docs on pkg, there is no need for this
workflow

Closes scylladb/scylladb#17908
2024-03-25 11:30:06 +02:00
Kefu Chai
0eb990fbf6 .github: skip "raison" when running codespell workflow
codespell workflow checks for misspellings to identify common
mispellings. it considers "raison" in "raison d'etre" (the accent
mark over "e" is removed , so the commit message can be encoded in
ASCII), to the misspelling of "reason" or "raisin". apparently, the
dictionary it uses does not include les mots francais les plus
utilises.

so, in this change, let's ignore "raison" for this very use case,
before we start the l10n support of the document.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes scylladb/scylladb#17985
2024-03-25 09:51:12 +02:00
Yaron Kaikov
cb2c69a3f7 github: mergify: Add Ref to original PR
When openning a backport PR, adding a reference to the original PR.
This will be used later for updating the original PR/issue once the
backport is done (with different label)

Closes scylladb/scylladb#17973
2024-03-25 08:12:47 +02:00
Botond Dénes
8b2856339a Merge 'github: sync-labels: use more descriptive name for workflow' from Kefu Chai
* rename `sync_labels.yaml` to `sync-labels.yaml`
* use more descrptive name for workflow

Closes scylladb/scylladb#17971

* github.com:scylladb/scylladb:
  github: sync-labels: use more descriptive name for workflow
  github: sync_labels: rename sync_labels to sync-labels
2024-03-22 10:01:56 +02:00
Yaron Kaikov
407d25e47b [mergify] delete backport branch after merge
Since those branches clutter the branch search UI and we don't need them
after merging

Closes scylladb/scylladb#17961
2024-03-22 09:51:22 +02:00
Kefu Chai
7ebdfdb705 github: sync-labels: use more descriptive name for workflow
"label-sync" is not very helpful for developers to understand what
this workflow is for.

the "name" field of a job shows in the webpage on github of the
pull request against which the job is performed, so if the author
or reviewer checks the status of the pull request, he/she would
notice these names aside of the workflow's name. for this very
job, what we have now is:

```
Sync labels / label-sync
```

after this change it will be:
```
Sync labels / Synchronize labels between PR and the issue(s) fixed by it
```

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2024-03-22 10:41:20 +08:00
Kefu Chai
af879759b9 github: sync_labels: rename sync_labels to sync-labels
to be more consistent with other github workflows

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2024-03-22 10:31:31 +08:00
Yaron Kaikov
5bd6b4f4c2 github: sync_labels: match issue number with better pattern
Seen in https://github.com/scylladb/scylladb/actions/runs/8357352616/job/22876314535

```
python .github/scripts/sync_labels.py --repo scylladb/scylladb --number 17309 --action labeled --label backport/none
  shell: /usr/bin/bash -e {0}
  env:
    GITHUB_TOKEN: ***

Found issue number: ('', '', '15465')
Traceback (most recent call last):
  File "/home/runner/work/scylladb/scylladb/.github/scripts/sync_labels.py", line 9[3](https://github.com/scylladb/scylladb/actions/runs/8357352616/job/22876314535#step:5:3), in <module>
    main()
  File "/home/runner/work/scylladb/scylladb/.github/scripts/sync_labels.py", line 89, in main
    sync_labels(repo, args.number, args.label, args.action, args.is_issue)
  File "/home/runner/work/scylladb/scylladb/.github/scripts/sync_labels.py", line [7](https://github.com/scylladb/scylladb/actions/runs/8357352616/job/22876314535#step:5:8)1, in sync_labels
    target = repo.get_issue(int(pr_or_issue_number))
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'tuple'
Error: Process completed with exit code 1.
```

Fixing the pattern to catch all GitHub supported close keywords as
describe in https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword

Fixed: https://github.com/scylladb/scylladb/issues/17917
Fixed: https://github.com/scylladb/scylladb/issues/17921

Closes scylladb/scylladb#17920
2024-03-21 14:25:24 +02:00
Yaron Kaikov
d859067486 [action sync labels] improve pr search when labeling an issue
This PR contains few fixes and improvment seen during
https://github.com/scylladb/scylladb/issues/15902 label addtion

When we add a label to an issue, we go through all PR.
1) Setting PR base to `master` (release PR are not relevant)
2) Since for each Issue we have only one PR, ending the search after a
   match was found
3) Make sure to skip PR with empty body (mainly debug one)
4) Set backport label prefix to `backport/`

Closes scylladb/scylladb#17912
2024-03-20 12:14:42 +02:00
Yaron Kaikov
0cbe5f1aa8 [action] add Fixes validation in backport PR
When we open a backport PR we should make sure the patch contains a ref to the issue it suppose to fix in order to make sure we have more accurate backport information

This action will only be triggered when base branch is `branch-*`

If `Fixes` are missing, this action will fail and notify the author.

Ref: https://github.com/scylladb/scylla-pkg/issues/3539

Closes scylladb/scylladb#17897
2024-03-20 08:55:36 +02:00
Yaron Kaikov
ad76f0325e [action] Sync labels from an Issue to linked PR
After merging https://github.com/scylladb/scylladb/pull/17365, all backport labels should be added to PR (before we used to add backport labels to the issues).

Adding a GitHub action which will be triggered in the following conditions only:

1) The base branch is `master` or `next`
2) Pull request events:
- opened: For every new PR that someone opens, we will sync all labels from the linked issue (if available)
- labeled: This role only applies to labels with the `backport/` prefix. When we add a new label for the backport we will update the relevant issue or PR to get them both to sync
- unlabeled: Same as `labeled` only applies to the `backport/` prefix. When we remove a label for backport we will update the relevant issue or pr

Closes scylladb/scylladb#17715
2024-03-19 09:17:07 +02:00
Yaron Kaikov
6406d3083c [mergify] set draft PR when conflicts
When Mergify open a backport PR and identify conflicts, it adding the
`conflicts` label. Since GitHub can't identify conflicts in PR, setting
a role to move PR to draft, this way we will not trigger CI

Once we resolve the conflicts developer should make the PR `ready for
review` (which is not draft) and then CI will be triggered

`conflict` label can also be removed

Closes scylladb/scylladb#17834
2024-03-18 14:45:08 +02:00
Beni Peled
bddac3279e Skip the backport-label workflow for draft pull requests
It's not necessary (and annoying) when this workflow runs and fails
against PRs in draft mode

Closes scylladb/scylladb#17864
2024-03-18 14:42:55 +02:00
Kefu Chai
85c4034495 .git: skip redis/lolwut.cc when scanning spelling errors
codespell reports "Nees" should be "Needs" but "Nees" is the last
name of Georg Nees. so it is not a misspelling. can should not be
fixed.

since the purpose of lolwut.cc is to display Redis version and
print a generative computer art. the one included by our version
was created by Georg Nees. since the LOLWUT command does not contain
business logic connected with scylladb, we don't lose a lot if skip
it when scanning for spelling errors. so, in this change, let's
skip it, this should silence one more warning from the github
codespell workflow.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes scylladb/scylladb#17770
2024-03-13 09:25:58 +02:00
Yaron Kaikov
ad842e5ad7 [mergify] Fix worng label and base branch for backport pr
This PR contains 2 fixes for mergify config file:
1) When openning a backport PR base branch should be `branch-x.y`

2) Once a commit is promoted, we should add the label
   `promoted-to-master`, in 5.4 configuraion we were using the wrong
label. fixing it

Closes scylladb/scylladb#17698
2024-03-08 10:08:09 +01:00
Botond Dénes
28639e6a59 Merge 'docs: trigger the docs-pages workflow on release branches' from Beni Peled
Currently, the github docs-pages workflow is triggered only when changes are merged to the master/enterprise branches, which means that in the case of changes to a release branch, for example, a fix to branch-5.4, or a branch-5.4>branch-2024.1 merge, the docs-pages is not triggering and therefore the documentation is not updated with the new change,

In this change, I added the `branch-**` pattern, so changes to release branches will trigger the workflow

Closes scylladb/scylladb#17281

* github.com:scylladb/scylladb:
  docs: always build from the default branch
  docs: trigger the docs-pages workflow on release branches
2024-03-07 10:01:50 +02:00
Beni Peled
c06282b312 docs: always build from the default branch
In order to publish the docs-pages from release branches (see the other
commit), we need to make sure that docs is always built from the default
branch which contains the updated conf.py

Ref https://github.com/scylladb/scylladb/pull/17281
2024-02-26 11:48:38 +02:00
Beni Peled
f59f70fc58 docs: trigger the docs-pages workflow on release branches
Currently, the github docs-pages workflow is triggered only when changes
are merged to the master/enterprise branches, which means that in the
case of changes to a release branch, for example, a fix to branch-5.4,
or a branch-5.4>branch-2024.1 merge, the docs-pages is not triggering and
therefore the documentation is not updated with the new change,

In this change, I added the `branch-**` pattern, so changes to release
branches will trigger the workflow.
2024-02-26 11:48:13 +02:00
Yaron Kaikov
493327afd8 [action] Add promoted label when commits are in master
In Scylla, we don't merge our PR but use ./script/pull_github_pr.shto close the pull request, addingcloses scylladb/scylladb remark and push changes tonext` branch.
One of the conditions for opening a backport PR is that all relevant commits are in master (passed gating), in this GitHub action, we will go through the list of commits once a push was made to master and will identify the relevant PR, and add promoted label to it. This will allow Mergify to start the process of backporting
2024-02-25 11:56:50 +02:00
Yaron Kaikov
6d07f7a0ea Add mergify (https://mergify.com/) configuration file
In this PR we introduce the .mergify.yml configuration file, which
include a set of rules that we will use for automating our backport
process.
For each supported OSS release (currently 5.2 and 5.4) we have an almost
identical configuration section which includes the four conditions before
we open a backport pr:

* PR should be closed
* PR should have the proper label. for example: backport/5.4 (we can
have multiple labels)
* Base branch should be master
* PR should be set with a promoted label - this condition will be set
automatically once the commits are promoted to the master branch (passed
gating)

Once all conditions are applied, the verify bot will open a backport PR and
will assign it to the author of the original PR, then CI will start
running, and only after it pass. we merge
2024-02-22 14:28:08 +02:00
Yaron Kaikov
44edb89f79 [actions] Add a check for backport labels
As part of the Automation of ScyllaDB backports project, each PR should get either a backport/none or backport/X.Y label.
Based on this label we will automatically open a backport PR for the relevant OSS release.
In this commit, I am adding a GitHub action to verify if such a label was added.
This only applies to PR with a based branch of master or next. For releases, we don't need this check
2024-02-15 22:40:09 +02:00
Kefu Chai
082ad51b71 .git: skip *.svg when scanning spelling errors
codespell reports following warnings:
```
Error: ./docs/kb/flamegraph.svg:1: writen ==> written
Error: ./docs/kb/flamegraph.svg:1: writen ==> written
Error: ./docs/kb/flamegraph.svg:1: storag ==> storage
Error: ./docs/kb/flamegraph.svg:1: storag ==> storage
```

these misspellings come from the flamgraph, which can be viewed
at https://opensource.docs.scylladb.com/master/kb/flamegraph.html
they are very likely to be truncated function names displayed
in the frames. and the spelling of these names are not responsible
of the author of the article, neither can we change them in a
meaningful way. so add it to the skip list.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes scylladb/scylladb#17215
2024-02-08 19:46:54 +02:00
Kefu Chai
6f55d68dd9 .git: add more skip words
these words are either

* shortened words: strategy => strat, read_from_primary => fro
* or acronyms: node_or_data => nd

before we rename them with better names, let's just add them to the
ignore word list.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes scylladb/scylladb#17002
2024-01-29 14:37:03 +02:00
Kefu Chai
cb5453d534 .git: only allow codespell to run on master branch
so that non-master branches are not read by 3rd-party tools unless
they are audited.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes scylladb/scylladb#16999
2024-01-29 09:04:20 +02:00
Kefu Chai
36e81f93d2 .git: do not apply codespell to licenses
we should keep the licenses as they are, even with misspellings.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes scylladb/scylladb#16992
2024-01-26 09:39:27 +02:00
Kefu Chai
48b8544a63 .git: add skip more words and directories
we use "ue" for the short of "update_expressions", before we change
our minds and use a more readable name, let's add "ue" to the
"ignore_word_list" option of the codespell.

also, use the abslolute path in "skip" option. as the absolute paths
are also used by codespell's own github workflow. and we are still
observing codespell github workflow is showing the misspelling errors
in our "test/" directory even we have it listed in "skip". so this
change should silence them as well.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes scylladb/scylladb#16593
2024-01-01 14:32:16 +02:00
Kefu Chai
fa3efe6166 .git: use ssh/key or token for auth
enable checkout action to get authenticated if the action need to
clone a non-public repo.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes scylladb/scylladb#16421
2023-12-15 11:34:50 +02:00
Kefu Chai
5ea3af067d .git: add codespell workflow
to identify misspelling in the code.

The GitHub actions in this workflow run codespell when a new pull
request is created targetting master or enterprise branch. Errors
will be annotated in the pull request. A new entry along with the
existing tests like build, unit test and dtest will be added to the
"checks" shown in github PR web UI. one can follow the "Details" to
find the details of the errors.

unfortunately, this check checks all text files unless they
are explicitly skipped, not just the new ones added / changed in the
PR under test. in other words, if there are 42 misspelling
errors in master, and you are adding a new one in your PR,
this workflow shows all of the 43 errors -- both the old
and new ones.

the misspelling in the code hurts the user experience and some
time developer's experience, but the text files under test/cql
can be sensitive to the text, sometimes, a tiny editing could
break the test, so it is added to the skip list.

So far, since there are lots of errors identified by the tool,
before we address all of them, the identified problem are only
annotated,  they are not considered as error. so, they don't
fail the check.

and in this change `only_warn` is set, so the check does not
fail even if there are misspellings. this prevents the distractions
before all problems are addressed. we can remove this setting in
future, once we either fix all the misspellings or add the ignore
words or skip files. but either way, the check is not considered
as blockers for merging the tested PR, even if this check fails --
the check failure is just represented for information purpose, unless
we make it a required in the github settings for the target
branch.

if want to change this, we can configure it in github's Branch
protectionn rule on a per-branch basis, to make this check a
must-pass.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes scylladb/scylladb#16285
2023-12-13 10:53:09 +02:00
Nadav Har'El
bae6f3387f CODEOWNERS: remove some entries
The ".github/CODEOWNERS" is used by github to recommend reviewers for
pull requests depending on the directories touched in the pull request.
Github ignores entries on that file who are not **maintainers**. Since
Jan is no longer a Scylla maintainer, I remove his entries in the list.

Additionally, I am removing *myself* from *some* of the directories.
For many years, it was an (unwritten) policy that experienced Scylla
developers are expected to help in reviewing pieces of the code they
are familiar with - even if they no longer work on that code today.
But as ScyllaDB the company grew, this is no longer true; The policy
is now that experienced developers are requested review only code in
their own or their team's area of responsibility - experienced developers
should help review *designs* of other parts, but not the actual code.
For this reason I'm removing my name from various directories.
I can still help review such code if asked specifically - but I will no
longer be the "default" reviewer for such code.

Signed-off-by: Nadav Har'El <nyh@scylladb.com>

Closes scylladb/scylladb#16239
2023-11-30 20:29:05 +02:00
David Garcia
70ce1b2002 docs: Separate conf.py
docs: update github actions

docs: fix Makefile tabs

Update docs-pr.yaml

Update Makefile

Closes #13323
2023-03-27 13:42:58 +03:00
Nadav Har'El
f275bfd57b Update CODEOWNERS file
Update the CODEOWNERS file with some people who joined different parts
of the project, and one person that left.

Note that despite is name, CODEOWNERS does not list "ownership" in any
strict sense of the word - it is more about who is willing and/or
knowledgeable enough to participate in reviewing changes to particular
files or directories. Github uses this file to automatically suggest
who should review a pull request.

Signed-off-by: Nadav Har'El <nyh@scylladb.com>

Closes #12216
2022-12-06 19:26:03 +02:00
David Garcia
26bc53771c docs: automatic previews configuration
Closes #11591
2022-11-04 15:44:22 +02:00
Botond Dénes
b3227ee9b4 CODEOWNERS: add @psarna and @nyh as owners for docs/alternator
Closes #11048
2022-07-16 11:39:04 +03:00
Botond Dénes
a7a36c5189 CODEOWNERS: add owners for docs/
User documentation was recently migrated to scylla.git, and this is
maintained by non scylla-core people. Add entries for docs/ so they are
notified when somebody submits changes to docs/.
2022-07-14 15:43:04 +03:00
Botond Dénes
2af12bbaaa CODEOWNERS: remove @haaawk
He is no longer with the company.
2022-07-14 15:41:26 +03:00
David Garcia
5adb5875f1 Add redirections 2022-06-28 09:39:14 +01:00
David Garcia
3e0f81180e docs: disable link checker
Closes #10434
2022-05-09 12:45:28 +02:00