Page MenuHomePhabricator

Remove plugins/.eslintrc.json
Closed, ResolvedPublic

Description

Gerrit attempts to reload plugins automatically every minute. The deployment repository has an eslint configuration for JavaScript plugin plugins/.eslintrc.json. Since it is not a plugin, Gerrit emits a log every minute with:

No Plugin provider was found that handles this file format: .eslintrc.json

We can either:

  • get scap to remove the file, or rethink the eslint configuration to no more need plugins/.eslintrc.json
  • move its config to the parent .eslintrc.json.

I have decided to delete the file to avoid messing up with eslint config files

Event Timeline

Change 884317 had a related patch set uploaded (by Hashar; author: Hashar):

[operations/software/gerrit@deploy/wmf/stable-3.5] scap: remove plugins/.eslintrc.json on finalize stage

https://gerrit.wikimedia.org/r/884317

hashar triaged this task as Low priority.Feb 1 2023, 5:33 PM
hashar moved this task from INBOX to Seen on the Release-Engineering-Team board.

Change 884317 merged by jenkins-bot:

[operations/software/gerrit@deploy/wmf/stable-3.5] scap: remove plugins/.eslintrc.json before promote

https://gerrit.wikimedia.org/r/884317

Mentioned in SAL (#wikimedia-operations) [2023-02-06T07:06:50Z] <hashar@deploy1002> Started deploy [gerrit/gerrit@e09efc0]: remove plugins/.eslintrc.json | T328134

Mentioned in SAL (#wikimedia-operations) [2023-02-06T07:07:01Z] <hashar@deploy1002> Finished deploy [gerrit/gerrit@e09efc0]: remove plugins/.eslintrc.json | T328134 (duration: 00m 10s)

The scap script (https://gerrit.wikimedia.org/r/c/operations/software/gerrit/+/884317) does not seem to delete the file from the proper directory cause I had to do TWO scap deploy in order for the file to vanish.

I have made it to run before promote and it is deleting "$SCAP_FINAL_PATH"/plugins/.eslintrc.json.

From scap checks documentation:

$SCAP_FINAL_PATH

A symbolic link created during the promote stage that points to the deployed code, constructed from the configured git_deploy_dir and the repo name, e.g. /srv/deployment/repo/name.
Note that this link will point to the previously deployed rev for checks that run prior to promote.

The check is instructed to run at the start of the promote stage and the environment variable thus hasn't been changed yet. I guess I should use SCAP_REV_PATH instead:

$SCAP_REV_PATH

Path to the revision of the code being deployed, e.g. /srv/deployment/repo/name-cache/revs/abc123.
This is the most reliable value for scripts that need to operate on the revision being deployed regardless of its current state.

Change 886801 had a related patch set uploaded (by Hashar; author: Hashar):

[operations/software/gerrit@deploy/wmf/stable-3.5] scap: use proper path when deleting .eslintrc.json

https://gerrit.wikimedia.org/r/886801

Change 886801 merged by jenkins-bot:

[operations/software/gerrit@deploy/wmf/stable-3.5] scap: use proper path when deleting .eslintrc.json

https://gerrit.wikimedia.org/r/886801

hashar claimed this task.