Skip to content

Commit ebf3d1e

Browse files
committed
fix: resolve failing CI checks
- Add missing license header to datasource.test.ts - Update golangci-lint script to skip plugins without Go files (opengemini is TypeScript-only) Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
1 parent 027ca93 commit ebf3d1e

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

opengemini/src/datasources/__tests__/datasource.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
// Copyright The Perses Authors
2+
// Licensed under the Apache License, Version 2.0 (the \"License\");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
//
6+
// http://www.apache.org/licenses/LICENSE-2.0
7+
//
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an \"AS IS\" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
114
describe('OpenGeminiDatasource', () => {
215
it('should pass sanity check', () => {
316
expect(true).toBe(true);

scripts/golangci-lint/golangci-lint.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,28 @@ package main
1616
import (
1717
"os"
1818
"os/exec"
19+
"path/filepath"
1920

2021
"github.com/perses/perses/scripts/pkg/npm"
2122
"github.com/sirupsen/logrus"
2223
)
2324

25+
func hasGoFiles(dir string) bool {
26+
// Check if go.mod exists
27+
_, err := os.Stat(filepath.Join(dir, "go.mod"))
28+
return err == nil
29+
}
30+
2431
func main() {
2532
var isError bool
2633

2734
for _, workspace := range npm.MustGetWorkspaces(".") {
35+
// Skip workspaces without Go files
36+
if !hasGoFiles(workspace) {
37+
logrus.Infof("skipping golangci-lint for the plugin %s (no Go files)", workspace)
38+
continue
39+
}
40+
2841
cmd := exec.Command("golangci-lint", "run")
2942
cmd.Dir = workspace
3043
cmd.Stdout = os.Stdout

0 commit comments

Comments
 (0)