• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mindersec / minder / 14315603253

07 Apr 2025 05:28PM UTC coverage: 56.758% (-0.01%) from 56.772%
14315603253

push

github

web-flow
build(deps): bump golangci/golangci-lint-action from 6.5.2 to 7.0.0 (#5548)

* build(deps): bump golangci/golangci-lint-action from 6.5.2 to 7.0.0

Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6.5.2 to 7.0.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/55c2c1448...148140484)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Migrate to golangci-lint version 2

* Fix newly-detected golangci-lint issues

* Fix remaining lint issues from new golangci-lint

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Evan Anderson <evan@stacklok.com>

53 of 164 new or added lines in 78 files covered. (32.32%)

2 existing lines in 1 file now uncovered.

18301 of 32244 relevant lines covered (56.76%)

36.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

9.68
/internal/providers/github/properties/fetcher.go
1
// SPDX-FileCopyrightText: Copyright 2024 The Minder Authors
2
// SPDX-License-Identifier: Apache-2.0
3

4
// Package properties provides utility functions for fetching and managing properties
5
package properties
6

7
import (
8
        "context"
9

10
        go_github "github.com/google/go-github/v63/github"
11

12
        minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
13
        "github.com/mindersec/minder/pkg/entities/properties"
14
)
15

16
// GhPropertyWrapper is a function that fetches a property from the GitHub API
17
type GhPropertyWrapper func(
18
        ctx context.Context, ghCli *go_github.Client, isOrg bool, lookupProperties *properties.Properties,
19
) (map[string]any, error)
20

21
// GhPropertyFetcher is an interface for fetching properties from the GitHub API
22
type GhPropertyFetcher interface {
23
        ghPropertyFetcherBase
24
        GetName(props *properties.Properties) (string, error)
25
}
26

27
type ghPropertyFetcherBase interface {
28
        WrapperForProperty(propertyKey string) GhPropertyWrapper
29
        AllPropertyWrappers() []GhPropertyWrapper
30
        OperationalProperties() []string
31
}
32

33
// GhPropertyFetcherFactory is an interface for creating GhPropertyFetcher instances
34
type GhPropertyFetcherFactory interface {
35
        EntityPropertyFetcher(entType minderv1.Entity) GhPropertyFetcher
36
}
37

38
type ghEntityFetcher struct{}
39

40
// NewPropertyFetcherFactory creates a new GhPropertyFetcherFactory
41
func NewPropertyFetcherFactory() GhPropertyFetcherFactory {
48✔
42
        return ghEntityFetcher{}
48✔
43
}
48✔
44

45
// EntityPropertyFetcher returns a GhPropertyFetcher for the given entity type
NEW
46
func (ghEntityFetcher) EntityPropertyFetcher(entType minderv1.Entity) GhPropertyFetcher {
×
47
        // nolint:exhaustive
×
48
        switch entType {
×
49
        case minderv1.Entity_ENTITY_PULL_REQUESTS:
×
50
                return NewPullRequestFetcher()
×
51
        case minderv1.Entity_ENTITY_REPOSITORIES:
×
52
                return NewRepositoryFetcher()
×
53
        case minderv1.Entity_ENTITY_ARTIFACTS:
×
54
                return NewArtifactFetcher()
×
55
        case minderv1.Entity_ENTITY_RELEASE:
×
56
                return NewReleaseFetcher()
×
57
        }
58

59
        return nil
×
60
}
61

62
type propertyOrigin struct {
63
        keys    []string
64
        wrapper GhPropertyWrapper
65
}
66

67
type propertyFetcherBase struct {
68
        propertyOrigins       []propertyOrigin
69
        operationalProperties []string
70
}
71

72
var _ ghPropertyFetcherBase = propertyFetcherBase{}
73

74
// WrapperForProperty returns the property wrapper for the given property key
75
func (pfb propertyFetcherBase) WrapperForProperty(propertyKey string) GhPropertyWrapper {
×
76
        for _, po := range pfb.propertyOrigins {
×
77
                for _, k := range po.keys {
×
78
                        if k == propertyKey {
×
79
                                return po.wrapper
×
80
                        }
×
81
                }
82
        }
83

84
        return nil
×
85
}
86

87
// AllPropertyWrappers returns all property wrappers for the repository
88
func (pfb propertyFetcherBase) AllPropertyWrappers() []GhPropertyWrapper {
×
89
        wrappers := make([]GhPropertyWrapper, 0, len(pfb.propertyOrigins))
×
90
        for _, po := range pfb.propertyOrigins {
×
91
                wrappers = append(wrappers, po.wrapper)
×
92
        }
×
93
        return wrappers
×
94
}
95

96
// OperationalProperties returns the operational properties for the repository
97
func (pfb propertyFetcherBase) OperationalProperties() []string {
×
98
        return pfb.operationalProperties
×
99
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc