Skip to content

feat!: add function sync script with upstream#138

Open
sunng87 wants to merge 9 commits into
mainfrom
feature/more-functions
Open

feat!: add function sync script with upstream#138
sunng87 wants to merge 9 commits into
mainfrom
feature/more-functions

Conversation

@sunng87
Copy link
Copy Markdown
Member

@sunng87 sunng87 commented Apr 3, 2026

add a python script to sync function with upstream.

Added a few functions that were missing from our implementation.

breaking change: removed holt_winters to sync with upstream.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 3, 2026

Codecov Report

❌ Patch coverage is 95.65217% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.54%. Comparing base (c4bebc8) to head (2ceecdb).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/parser/ast.rs 95.57% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #138      +/-   ##
==========================================
- Coverage   98.93%   98.54%   -0.39%     
==========================================
  Files          15       15              
  Lines        6560     6959     +399     
==========================================
+ Hits         6490     6858     +368     
- Misses         70      101      +31     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sunng87 sunng87 requested review from evenyag and waynexia April 3, 2026 05:42
@sunng87
Copy link
Copy Markdown
Member Author

sunng87 commented Apr 9, 2026

@waynexia do you think we can remove holt_winters to follow upstream?

@evenyag
Copy link
Copy Markdown
Contributor

evenyag commented Apr 13, 2026

@waynexia do you think we can remove holt_winters to follow upstream?

Maybe we should keep it for compatibility with prometheus 2.x.

@evenyag
Copy link
Copy Markdown
Contributor

evenyag commented Apr 13, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5aa62345ca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/parser/ast.rs Outdated
@sunng87 sunng87 changed the title feat: add function sync script with upstream feat!: add function sync script with upstream May 13, 2026
Comment thread src/parser/ast.rs Outdated
@evenyag
Copy link
Copy Markdown
Contributor

evenyag commented May 13, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8935472c64

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/parser/function.rs
Comment on lines +328 to +331
"info",
vec![ValueType::Vector, ValueType::Vector],
1,
ValueType::Vector,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Validate info() second argument as selector syntax

Adding info as vec![ValueType::Vector, ValueType::Vector] without a dedicated AST check means any instant-vector expression is accepted as the optional second argument (for example, info(up, rate(http_requests_total[5m]))), even though Prometheus only allows a label-matcher selector in braces for this parameter. This causes the parser to accept queries that are invalid upstream, reducing compatibility and potentially breaking users when those queries are executed against real Prometheus implementations.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prometheus has a special check for info. will address this in next patch

Copy link
Copy Markdown
Contributor

@evenyag evenyag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other looks good.

Comment thread src/parser/ast.rs
Comment on lines +1621 to +1625
let expected_idx = if i < arg_types.len() {
i
} else {
arg_types.len() - 1
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found another difference:

https://github.com/prometheus/prometheus/blob/ce93018f4e5bbe216fdc8dd30ad738b20b2a46f5/promql/parser/parse.go#L862-L866

Do we need to break if variadic is 0 when i >= arg_types.len()?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this case should be checked by check_call_arity to ensure len(args) == len(arg_types) when variadic is 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants