Skip to content

Commit 19530fd

Browse files
committed
Initial commit
0 parents  commit 19530fd

3,986 files changed

Lines changed: 1210931 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Logs
2+
**/logs
3+
**/*.log
4+
**/npm-debug.log*
5+
**/yarn-debug.log*
6+
**/yarn-error.log*
7+
**/pnpm-debug.log*
8+
**/lerna-debug.log*
9+
10+
**/node_modules
11+
**/dist
12+
**/dist-ssr
13+
**/*.local
14+
15+
# Editor directories and files
16+
**/.vscode/*
17+
!**/.vscode/extensions.json
18+
**/.idea
19+
**/.DS_Store
20+
**/*.suo
21+
**/*.ntvs*
22+
**/*.njsproj
23+
**/*.sln
24+
**/*.sw?
25+
26+
.git
27+
vendor
28+
gocache-for-docker
29+
.idea
30+
.zed
31+
.vscode
32+
33+

.github/dependabot.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
- package-ecosystem: "gomod"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"
11+
- package-ecosystem: "npm"
12+
directory: "/cmd/logql-to-logsql/web/ui"
13+
schedule:
14+
interval: "weekly"
15+
- package-ecosystem: "docker"
16+
directory: "/"
17+
schedule:
18+
interval: "weekly"

.github/workflows/lint.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Lint
2+
3+
on:
4+
push: { }
5+
pull_request: { }
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v6
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Set up Go
17+
uses: actions/setup-go@v6
18+
with:
19+
go-version: "1.25.5"
20+
21+
- name: Run ui build
22+
run: make ui-build
23+
24+
- name: golangci-lint
25+
uses: golangci/golangci-lint-action@v9
26+
with:
27+
version: v2.4
28+
29+
- name: Run lint
30+
run: make lint
31+
32+
- name: Run check
33+
run: make check
34+
35+
- name: Run test
36+
run: make test
37+
38+
- name: Run build
39+
run: make build
40+

.github/workflows/release.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: build
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
packages: write
11+
id-token: write
12+
13+
jobs:
14+
release-logql-to-logsql:
15+
runs-on: ubuntu-latest
16+
steps:
17+
18+
- name: Checkout
19+
uses: actions/checkout@v6
20+
with:
21+
fetch-depth: '0'
22+
fetch-tags: 'true'
23+
24+
- name: Setup Go
25+
uses: actions/setup-go@v6
26+
with:
27+
go-version: 1.25.5
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v6
31+
with:
32+
node-version: 24
33+
34+
- name: Check licenses and vulnerabilities
35+
run: make check
36+
37+
- name: Fetch tags
38+
run: |
39+
if [[ "${{ github.ref_type }}" != "tag" ]]; then
40+
git fetch --tags
41+
else
42+
echo "Skipping tag fetch - already on tag ${{ github.ref_name }}"
43+
fi
44+
45+
- name: Run ui build
46+
run: |
47+
if [[ "${{ github.ref_type }}" == "tag" ]]; then
48+
TAG_VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
49+
else
50+
LATEST_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(-.*)?$' | head -n 1)
51+
[ -z "$LATEST_TAG" ] && { echo "No release tag found"; exit 1; }
52+
TAG_VERSION=$(echo "$LATEST_TAG" | sed 's/^v//')
53+
echo "Using latest tag: $LATEST_TAG"
54+
fi
55+
cp cmd/logql-to-logsql/web/ui/package.json cmd/logql-to-logsql/web/ui/package.json.backup
56+
cp cmd/logql-to-logsql/web/ui/package-lock.json cmd/logql-to-logsql/web/ui/package-lock.json.backup
57+
sed -i "s/\${VERSION}/$TAG_VERSION/g" cmd/logql-to-logsql/web/ui/package.json
58+
echo "Version: $TAG_VERSION"
59+
make ui-build
60+
cat cmd/logql-to-logsql/web/ui/package.json.backup > cmd/logql-to-logsql/web/ui/package.json
61+
cat cmd/logql-to-logsql/web/ui/package-lock.json.backup > cmd/logql-to-logsql/web/ui/package-lock.json
62+
rm cmd/logql-to-logsql/web/ui/package.json.backup
63+
rm cmd/logql-to-logsql/web/ui/package-lock.json.backup
64+
65+
- name: golangci-lint
66+
uses: golangci/golangci-lint-action@v9
67+
with:
68+
version: v2.4
69+
70+
- name: Tests
71+
run: make test
72+
73+
- name: Set up QEMU
74+
uses: docker/setup-qemu-action@v3
75+
76+
- name: Set up Docker Buildx
77+
uses: docker/setup-buildx-action@v3
78+
79+
- name: Docker Login
80+
uses: docker/login-action@v3
81+
with:
82+
registry: ghcr.io
83+
username: ${{ github.repository_owner }}
84+
password: ${{ secrets.GITHUB_TOKEN }}
85+
86+
- name: Build and release
87+
uses: goreleaser/goreleaser-action@v6
88+
if: success() && startsWith(github.ref, 'refs/tags/')
89+
with:
90+
args: release --clean --verbose --timeout 60m -f .goreleaser.yaml
91+
env:
92+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93+

.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
25+
26+
# Binaries
27+
/logql-to-logsql
28+
29+
# Built UI output (generated by `make ui-build`)
30+
/cmd/logql-to-logsql/web/dist/
31+
32+
config.json
33+
fly.toml

.golangci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: "2"
2+
linters:
3+
exclusions:
4+
generated: lax
5+
presets:
6+
- comments
7+
- common-false-positives
8+
- legacy
9+
- std-error-handling
10+
paths:
11+
- third_party$
12+
- builtin$
13+
- examples$
14+
15+
formatters:
16+
exclusions:
17+
generated: lax
18+
paths:
19+
- third_party$
20+
- builtin$
21+
- examples$
22+

.goreleaser.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
version: 2
2+
project_name: logql-to-logsql
3+
4+
builds:
5+
- env:
6+
- CGO_ENABLED=0
7+
goos:
8+
- linux
9+
- windows
10+
- darwin
11+
goarch:
12+
- amd64
13+
- arm64
14+
- arm
15+
- "386"
16+
main: ./cmd/logql-to-logsql/main.go
17+
binary: logql-to-logsql
18+
ldflags:
19+
- -X main.version={{.Version}} -X main.date={{ .CommitDate }}
20+
21+
archives:
22+
- formats: [tar.gz]
23+
name_template: >-
24+
{{ .ProjectName }}_
25+
{{- title .Os }}_
26+
{{- if eq .Arch "amd64" }}x86_64
27+
{{- else if eq .Arch "386" }}i386
28+
{{- else }}{{ .Arch }}{{ end }}
29+
{{- if .Arm }}v{{ .Arm }}{{ end }}
30+
format_overrides:
31+
- goos: windows
32+
formats: [zip]
33+
34+
checksum:
35+
name_template: 'checksums.txt'
36+
37+
snapshot:
38+
version_template: "{{ .Tag }}-next"
39+
40+
changelog:
41+
sort: asc
42+
43+
dockers_v2:
44+
- images:
45+
- "ghcr.io/victoriametrics-community/logql-to-logsql"
46+
tags:
47+
- latest
48+
- "v{{ .Version }}"
49+
dockerfile: Dockerfile.goreleaser
50+
labels:
51+
"org.opencontainers.image.title": "{{.ProjectName}}"
52+
"org.opencontainers.image.description": "{{.ProjectName}}"
53+
"org.opencontainers.image.url": "{{.GitURL}}"
54+
"org.opencontainers.image.source": "{{.GitURL}}"
55+
"org.opencontainers.image.version": "{{.Version}}"
56+
"org.opencontainers.image.created": "{{.Date}}"
57+
"org.opencontainers.image.revision": "{{.FullCommit}}"
58+
"org.opencontainers.image.licenses": "Apache-2.0"
59+
annotations:
60+
"project": "{{.ProjectName}}"
61+
platforms:
62+
- linux/amd64
63+
- linux/arm64
64+

.wwhrd.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
allowlist:
2+
- Apache-2.0
3+
- MIT
4+
- BSD-3-Clause
5+
- BSD-2-Clause
6+
- ISC
7+
- MPL-2.0
8+

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues and other contributions
42+
that are not aligned to this Code of Conduct or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing or otherwise unacceptable behavior may be
58+
reported by contacting the project team at info@victoriametrics.com. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate for the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
<https://www.contributor-covenant.org/faq>

0 commit comments

Comments
 (0)