Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from prometheus:main #56

Merged
merged 57 commits into from
Mar 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
d71bbf9
chore(deps-dev): bump @eslint/eslintrc from 3.2.0 to 3.3.1 in /web/ui
dependabot[bot] Mar 22, 2025
c30037d
chore(deps): bump @codemirror/language in /web/ui/react-app
dependabot[bot] Mar 22, 2025
d3ec2b9
chore(deps): bump sanitize-html in /web/ui/react-app
dependabot[bot] Mar 22, 2025
cc5669d
chore(deps): bump sanitize-html from 2.14.0 to 2.15.0 in /web/ui
dependabot[bot] Mar 22, 2025
40240c7
chore(deps): bump @codemirror/view from 6.36.2 to 6.36.4 in /web/ui
dependabot[bot] Mar 22, 2025
9aaf7ca
chore(deps): bump @uiw/react-codemirror in /web/ui
dependabot[bot] Mar 22, 2025
5184709
chore(deps): bump downshift from 9.0.8 to 9.0.9 in /web/ui/react-app
dependabot[bot] Mar 22, 2025
7f1cff1
chore(deps-dev): bump prettier from 3.5.2 to 3.5.3 in /web/ui/react-app
dependabot[bot] Mar 22, 2025
642d36c
chore(deps): bump @types/lodash from 4.17.13 to 4.17.16 in /web/ui
dependabot[bot] Mar 22, 2025
c747407
chore(deps): bump @codemirror/view in /web/ui/react-app
dependabot[bot] Mar 22, 2025
692259e
chore(deps-dev): bump @types/node in /web/ui/react-app
dependabot[bot] Mar 22, 2025
65f5183
chore(deps-dev): bump sinon from 19.0.2 to 19.0.4 in /web/ui/react-app
dependabot[bot] Mar 22, 2025
d7353e5
chore(deps-dev): bump @types/react from 19.0.6 to 19.0.12 in /web/ui
dependabot[bot] Mar 22, 2025
d7042f1
chore(deps): bump @mantine/hooks from 7.15.3 to 7.17.2 in /web/ui
dependabot[bot] Mar 22, 2025
2233d29
chore(deps): bump @reduxjs/toolkit from 2.5.0 to 2.6.1 in /web/ui
dependabot[bot] Mar 22, 2025
9a5f125
Merge pull request #16306 from prometheus/dependabot/npm_and_yarn/web…
github-actions[bot] Mar 23, 2025
0f80db3
Merge pull request #16305 from prometheus/dependabot/npm_and_yarn/web…
github-actions[bot] Mar 23, 2025
2a41054
Merge pull request #16294 from prometheus/dependabot/npm_and_yarn/web…
github-actions[bot] Mar 23, 2025
862cf16
chore(deps): bump @mantine/core from 7.15.3 to 7.17.2 in /web/ui
dependabot[bot] Mar 23, 2025
2cb720f
chore(deps): bump @tabler/icons-react from 3.28.1 to 3.31.0 in /web/ui
dependabot[bot] Mar 23, 2025
814d688
Merge pull request #16288 from prometheus/dependabot/npm_and_yarn/web…
github-actions[bot] Mar 23, 2025
464ae44
Merge pull request #16290 from prometheus/dependabot/npm_and_yarn/web…
github-actions[bot] Mar 23, 2025
57c7bf4
Merge pull request #16281 from prometheus/dependabot/npm_and_yarn/web…
github-actions[bot] Mar 23, 2025
a873252
Merge pull request #16280 from prometheus/dependabot/npm_and_yarn/web…
github-actions[bot] Mar 23, 2025
01dd6c7
Merge pull request #16278 from prometheus/dependabot/npm_and_yarn/web…
github-actions[bot] Mar 23, 2025
df7f0a9
Merge pull request #16276 from prometheus/dependabot/npm_and_yarn/web…
github-actions[bot] Mar 23, 2025
5af6c98
Merge pull request #16275 from prometheus/dependabot/npm_and_yarn/web…
github-actions[bot] Mar 23, 2025
8689272
Merge pull request #16274 from prometheus/dependabot/npm_and_yarn/web…
github-actions[bot] Mar 23, 2025
881699a
Merge pull request #16273 from prometheus/dependabot/npm_and_yarn/web…
github-actions[bot] Mar 23, 2025
e8d04ea
Merge pull request #16272 from prometheus/dependabot/npm_and_yarn/web…
github-actions[bot] Mar 23, 2025
e872cd1
Merge pull request #16267 from prometheus/dependabot/npm_and_yarn/web…
github-actions[bot] Mar 23, 2025
e56f521
Merge pull request #16266 from prometheus/dependabot/npm_and_yarn/web…
github-actions[bot] Mar 23, 2025
e97b61e
chore(deps): bump @codemirror/state from 6.5.0 to 6.5.2 in /web/ui
dependabot[bot] Mar 23, 2025
400c7d1
Merge pull request #16263 from prometheus/dependabot/npm_and_yarn/web…
github-actions[bot] Mar 23, 2025
7c0db5c
chore(deps-dev): bump @types/react-dom from 19.0.3 to 19.0.4 in /web/ui
dependabot[bot] Mar 23, 2025
138c977
chore(deps): bump react-router-dom from 7.1.1 to 7.4.0 in /web/ui
dependabot[bot] Mar 23, 2025
5ba0a7c
chore(deps): bump uplot from 1.6.31 to 1.6.32 in /web/ui
dependabot[bot] Mar 23, 2025
29c845f
chore(deps-dev): bump globals from 15.14.0 to 16.0.0 in /web/ui (#16282)
dependabot[bot] Mar 23, 2025
242c3ab
chore(deps-dev): bump nock from 13.5.6 to 14.0.1 in /web/ui (#16110)
dependabot[bot] Mar 23, 2025
cde95c7
Merge pull request #16187 from prometheus/dependabot/npm_and_yarn/web…
github-actions[bot] Mar 23, 2025
a5a4949
chore(deps): bump sass from 1.85.1 to 1.86.0 in /web/ui/react-app
dependabot[bot] Mar 23, 2025
3dfea0c
chore(deps-dev): bump eslint from 9.18.0 to 9.23.0 in /web/ui
dependabot[bot] Mar 23, 2025
f47dffe
Merge pull request #16103 from prometheus/dependabot/npm_and_yarn/web…
github-actions[bot] Mar 23, 2025
0f7f85e
chore(deps): bump @mantine/dates from 7.15.3 to 7.17.2 in /web/ui
dependabot[bot] Mar 23, 2025
e0ead70
Convert .eslintrc.json to eslint.config.mjs
aknuds1 Mar 23, 2025
226058e
Merge pull request #16269 from prometheus/dependabot/npm_and_yarn/web…
github-actions[bot] Mar 23, 2025
090f0a4
Merge pull request #16284 from prometheus/dependabot/npm_and_yarn/web…
github-actions[bot] Mar 23, 2025
c09bd2c
Merge pull request #16270 from prometheus/dependabot/npm_and_yarn/web…
github-actions[bot] Mar 23, 2025
c7ea28c
parser: remove expired link from comment (#16189)
pomyslowynick Mar 23, 2025
fc74551
Merge pull request #16271 from prometheus/dependabot/npm_and_yarn/web…
github-actions[bot] Mar 23, 2025
02354a1
Merge pull request #16304 from prometheus/dependabot/npm_and_yarn/web…
github-actions[bot] Mar 23, 2025
611b479
chore(deps): bump @mantine/code-highlight in /web/ui
dependabot[bot] Mar 23, 2025
d816160
chore(deps): bump @mantine/notifications in /web/ui
dependabot[bot] Mar 23, 2025
6e6ea34
Fix linting
aknuds1 Mar 23, 2025
f158d27
Merge pull request #16297 from prometheus/dependabot/npm_and_yarn/web…
github-actions[bot] Mar 23, 2025
b99c542
Merge pull request #16277 from prometheus/dependabot/npm_and_yarn/web…
github-actions[bot] Mar 23, 2025
5d2b760
Merge pull request #16279 from prometheus/dependabot/npm_and_yarn/web…
github-actions[bot] Mar 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion model/textparse/openmetricsparse.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (l *openMetricsLexer) Error(es string) {

// OpenMetricsParser parses samples from a byte slice of samples in the official
// OpenMetrics text exposition format.
// This is based on the working draft https://docs.google.com/document/u/1/d/1KwV0mAXwwbvvifBvDKH_LU1YjyXE_wxCkHNoCGq1GX0/edit
// Specification can be found at https://prometheus.io/docs/specs/om/open_metrics_spec/
type OpenMetricsParser struct {
l *openMetricsLexer
builder labels.ScratchBuilder
Expand Down
38 changes: 19 additions & 19 deletions web/ui/mantine-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,54 +15,54 @@
"@codemirror/autocomplete": "^6.18.4",
"@codemirror/language": "^6.10.8",
"@codemirror/lint": "^6.8.4",
"@codemirror/state": "^6.4.1",
"@codemirror/view": "^6.36.2",
"@codemirror/state": "^6.5.2",
"@codemirror/view": "^6.36.4",
"@floating-ui/dom": "^1.6.12",
"@lezer/common": "^1.2.3",
"@lezer/highlight": "^1.2.1",
"@mantine/code-highlight": "^7.15.2",
"@mantine/core": "^7.11.2",
"@mantine/dates": "^7.15.3",
"@mantine/hooks": "^7.11.2",
"@mantine/notifications": "^7.15.3",
"@mantine/code-highlight": "^7.17.2",
"@mantine/core": "^7.17.2",
"@mantine/dates": "^7.17.2",
"@mantine/hooks": "^7.17.2",
"@mantine/notifications": "^7.17.2",
"@microsoft/fetch-event-source": "^2.0.1",
"@nexucis/fuzzy": "^0.5.1",
"@nexucis/kvsearch": "^0.9.1",
"@prometheus-io/codemirror-promql": "0.302.1",
"@reduxjs/toolkit": "^2.5.0",
"@tabler/icons-react": "^3.28.1",
"@reduxjs/toolkit": "^2.6.1",
"@tabler/icons-react": "^3.31.0",
"@tanstack/react-query": "^5.67.1",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.2.0",
"@types/lodash": "^4.17.13",
"@types/lodash": "^4.17.16",
"@types/sanitize-html": "^2.13.0",
"@uiw/react-codemirror": "^4.23.7",
"@uiw/react-codemirror": "^4.23.10",
"clsx": "^2.1.1",
"dayjs": "^1.11.10",
"lodash": "^4.17.21",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-infinite-scroll-component": "^6.1.0",
"react-redux": "^9.2.0",
"react-router-dom": "^7.1.1",
"sanitize-html": "^2.14.0",
"uplot": "^1.6.31",
"react-router-dom": "^7.4.0",
"sanitize-html": "^2.15.0",
"uplot": "^1.6.32",
"uplot-react": "^1.2.2",
"use-query-params": "^2.2.1"
},
"devDependencies": {
"@eslint/compat": "^1.2.4",
"@eslint/eslintrc": "^3.2.0",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.21.0",
"@types/react": "^19.0.6",
"@types/react-dom": "^19.0.0",
"@types/react": "^19.0.12",
"@types/react-dom": "^19.0.4",
"@typescript-eslint/eslint-plugin": "^8.20.0",
"@typescript-eslint/parser": "^8.25.0",
"@vitejs/plugin-react": "^4.3.4",
"eslint": "^9.18.0",
"eslint": "^9.23.0",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-react-refresh": "^0.4.19",
"globals": "^15.14.0",
"globals": "^16.0.0",
"jsdom": "^25.0.1",
"postcss": "^8.4.47",
"postcss-preset-mantine": "^1.17.0",
Expand Down
34 changes: 0 additions & 34 deletions web/ui/module/codemirror-promql/.eslintrc.json

This file was deleted.

47 changes: 47 additions & 0 deletions web/ui/module/codemirror-promql/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { fixupConfigRules } from '@eslint/compat';
import tsParser from '@typescript-eslint/parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [{
ignores: ['**/dist', '**/.eslintrc.cjs', 'node_modules/**'],
}, ...fixupConfigRules(compat.extends(
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
)), {
languageOptions: {
parser: tsParser,
},
rules: {
'@typescript-eslint/explicit-function-return-type': ['off'],
'eol-last': [
'error',
'always',
],
'object-curly-spacing': [
'error',
'always',
],
'prefer-const': 'warn',
'comma-dangle': [
'error',
{
'arrays': 'always-multiline',
'objects': 'always-multiline',
'imports': 'always-multiline',
},
],
},
},
];
6 changes: 3 additions & 3 deletions web/ui/module/codemirror-promql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@
"@codemirror/autocomplete": "^6.18.4",
"@codemirror/language": "^6.10.8",
"@codemirror/lint": "^6.8.4",
"@codemirror/state": "^6.3.3",
"@codemirror/view": "^6.36.2",
"@codemirror/state": "^6.5.2",
"@codemirror/view": "^6.36.4",
"@lezer/common": "^1.2.3",
"@lezer/highlight": "^1.2.0",
"@lezer/lr": "^1.4.2",
"eslint-plugin-prettier": "^5.2.3",
"isomorphic-fetch": "^3.0.0",
"nock": "^13.5.6"
"nock": "^14.0.1"
},
"peerDependencies": {
"@codemirror/autocomplete": "^6.4.0",
Expand Down
7 changes: 5 additions & 2 deletions web/ui/module/codemirror-promql/src/complete/hybrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ function isAggregatorWithParam(functionCallBody: SyntaxNode): boolean {
export function analyzeCompletion(state: EditorState, node: SyntaxNode, pos: number): Context[] {
const result: Context[] = [];
switch (node.type.id) {
case 0: // 0 is the id of the error node
case 0: {
// 0 is the id of the error node
if (node.parent?.type.id === OffsetExpr) {
// we are likely in the given situation:
// `metric_name offset 5` that leads to this tree:
Expand Down Expand Up @@ -270,7 +271,8 @@ export function analyzeCompletion(state: EditorState, node: SyntaxNode, pos: num
result.push({ kind: ContextKind.BinOp });
}
break;
case Identifier:
}
case Identifier: {
// sometimes an Identifier has an error has parent. This should be treated in priority
if (node.parent?.type.id === 0) {
const errorNodeParent = node.parent.parent;
Expand Down Expand Up @@ -380,6 +382,7 @@ export function analyzeCompletion(state: EditorState, node: SyntaxNode, pos: num
}
}
break;
}
case PromQL:
if (node.firstChild !== null && node.firstChild.type.id === 0) {
// this situation can happen when there is nothing in the text area and the user is explicitly triggering the autocompletion (with ctrl + space)
Expand Down
6 changes: 4 additions & 2 deletions web/ui/module/codemirror-promql/src/parser/matcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@ function createMatcher(labelMatcher: SyntaxNode, state: EditorState): Matcher {
case QuotedLabelName:
matcher.name = state.sliceDoc(cursor.from, cursor.to).slice(1, -1);
break;
case MatchOp:
case MatchOp: {
const ope = cursor.node.firstChild;
if (ope) {
matcher.type = ope.type.id;
}
break;
}
case StringLiteral:
matcher.value = state.sliceDoc(cursor.from, cursor.to).slice(1, -1);
break;
Expand All @@ -63,12 +64,13 @@ function createMatcher(labelMatcher: SyntaxNode, state: EditorState): Matcher {
case LabelName:
matcher.name = state.sliceDoc(cursor.from, cursor.to);
break;
case MatchOp:
case MatchOp: {
const ope = cursor.node.firstChild;
if (ope) {
matcher.type = ope.type.id;
}
break;
}
case StringLiteral:
matcher.value = state.sliceDoc(cursor.from, cursor.to).slice(1, -1);
break;
Expand Down
2 changes: 1 addition & 1 deletion web/ui/module/codemirror-promql/src/parser/parser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ describe('promql operations', () => {
],
},
{
expr: `{'foo\`metric':'bar'}`, // eslint-disable-line
expr: `{'foo\`metric':'bar'}`,
expectedValueType: ValueType.vector,
expectedDiag: [],
},
Expand Down
9 changes: 6 additions & 3 deletions web/ui/module/codemirror-promql/src/parser/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,25 +116,27 @@ export class Parser {
case ParenExpr:
this.checkAST(node.getChild('Expr'));
break;
case UnaryExpr:
case UnaryExpr: {
const unaryExprType = this.checkAST(node.getChild('Expr'));
if (unaryExprType !== ValueType.scalar && unaryExprType !== ValueType.vector) {
this.addDiagnostic(node, `unary expression only allowed on expressions of type scalar or instant vector, got ${unaryExprType}`);
}
break;
case SubqueryExpr:
}
case SubqueryExpr: {
const subQueryExprType = this.checkAST(node.getChild('Expr'));
if (subQueryExprType !== ValueType.vector) {
this.addDiagnostic(node, `subquery is only allowed on instant vector, got ${subQueryExprType} in ${node.name} instead`);
}
break;
}
case MatrixSelector:
this.checkAST(node.getChild('Expr'));
break;
case VectorSelector:
this.checkVectorSelector(node);
break;
case StepInvariantExpr:
case StepInvariantExpr: {
const exprValue = this.checkAST(node.getChild('Expr'));
if (exprValue !== ValueType.vector && exprValue !== ValueType.matrix) {
this.addDiagnostic(node, `@ modifier must be preceded by an instant selector vector or range vector selector or a subquery`);
Expand All @@ -148,6 +150,7 @@ export class Parser {
// So far I didn't find the way to fix it. I think it's likely due to the fact we are building an ESM package which is now something stable in nodeJS/javascript but still experimental in typescript.
// For the above reason, we decided to drop these checks.
break;
}
}

return getType(node);
Expand Down
6 changes: 4 additions & 2 deletions web/ui/module/codemirror-promql/src/parser/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,21 @@ export function getType(node: SyntaxNode | null): ValueType {
return getType(node.getChild('Expr'));
case UnaryExpr:
return getType(node.getChild('Expr'));
case BinaryExpr:
case BinaryExpr: {
const lt = getType(node.firstChild);
const rt = getType(node.lastChild);
if (lt === ValueType.scalar && rt === ValueType.scalar) {
return ValueType.scalar;
}
return ValueType.vector;
case FunctionCall:
}
case FunctionCall: {
const funcNode = node.firstChild?.firstChild;
if (!funcNode) {
return ValueType.none;
}
return getFunction(funcNode.type.id).returnType;
}
case StepInvariantExpr:
return getType(node.getChild('Expr'));
default:
Expand Down
Loading
Loading