keybase / keybase/client

Presence of commented out code in Jenkinsfile on master branch

Open
#5,986 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
9.2k
Forks
1.3k
Avg merge
12h 58m
Merged PRs (30d)
56

Description

In your Jenkinsfile on the master branch, you have blocks of commented out code in two places:

In my experience, allowing commented out code to be committed into your repository, especially on the master branch, is usually much more trouble that it is worth. Developers frequently commit commented out code because they only want to disable that code for a short time, and they intended to re-enable it at some point in the future. However what usually ends up happening is that the commented out code ends up being forgotten, and when other developers look at the code in the future they are unsure what the commented out code was supposed to do, or why it was commented out in the first place. Often times code which is commented out with the intention of re-enabling it later ends up being rendered obsolete or unnecessary by other changes before it is ever re-enabled, so the commented out code just sits there forever, as no one can remember why it was commented out in the first place, so no one wants to risk removing it completely. The result is confusion and difficulty with maintenance and/or upgrades of the code in the long term.

Commenting out code is usually fine when done locally on a developer's machine for quickly testing or debugging something as long they don't commit it into source control (or if they do commit it on a feature branch, at the very least it should be removed before the commented out code gets merged to a long-term branch like master). If code does need to be disabled temporarily in source control, instead of commenting it out it is usually better to simply delete it. As long as you delete it in a single commit with no other code changes, then re-enabling the code later is a simple matter of reverting that commit down the line. In the commit which deleted the code, you can also include a brief description of why the code was deleted and what has to happen before it can be restored as part of the commit message. You can also add an item to your technical debt backlog to keep track of the need to revert the deleted code in the future.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open Jenkinsfile on the master branch and inspect the commented blocks at lines 19-36 and 259-267. Confirm that the requested cleanup is limited to those locations. Done means the commented-out code is removed without unrelated changes.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, ci-cd
Issue type
Refactor
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.