graphite-project / graphite-project/graphite-web

Consolidate `add` and `offset` functions

Open
#2,669 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement pinned
Dominant language
JavaScript
Stars
6.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

Is your feature request related to a problem? Please describe.
As I see and discuss with @dzhdanov, add and offset are pretty much the same functions with different descriptions and small implementation details.

Describe the solution you'd like
One function should be an alias to another with only one implementation

Describe alternatives you've considered
The alternative would be to leave it as it is, but now it doesn't look good, even from the documentation side: add vs offset

Contributor guide

Open the contributing guide

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

Start in webapp/graphite/render/functions.py, at the cited implementations of add and offset. Compare their behavior and descriptions, then consolidate them so one function aliases the other while preserving the existing interfaces. Done means there is only one implementation and both documented functions retain the intended behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.