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

mongodb / mongodb-atlas-cli / 25848964073

14 May 2026 07:59AM UTC coverage: 22.479% (-41.3%) from 63.771%
25848964073

push

github

web-flow
build(deps): bump test-summary/action from 2.4 to 2.6 (#4576)

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

8987 of 39979 relevant lines covered (22.48%)

0.25 hits per line

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

0.0
/internal/cli/api/profile.go
1
// Copyright 2024 MongoDB Inc
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
//     http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15
package api
16

17
import (
18
        "github.com/mongodb/atlas-cli-core/config"
19
        "github.com/mongodb/mongodb-atlas-cli/atlascli/internal/flag"
20
        "github.com/mongodb/mongodb-atlas-cli/atlascli/internal/pointer"
21
)
22

23
type ProfileFlagValueProvider struct {
24
        profile *config.Profile
25
}
26

27
func NewProfileFlagValueProvider(profile *config.Profile) *ProfileFlagValueProvider {
×
28
        return &ProfileFlagValueProvider{
×
29
                profile: profile,
×
30
        }
×
31
}
×
32

33
func NewProfileFlagValueProviderForDefaultProfile() *ProfileFlagValueProvider {
×
34
        return NewProfileFlagValueProvider(config.Default())
×
35
}
×
36

37
func (p *ProfileFlagValueProvider) ValueForFlag(flagName string) (*string, error) {
×
38
        switch flagName {
×
39
        case flag.GroupID:
×
40
                return noneEmptyStringPointer(p.profile.ProjectID()), nil
×
41
        case flag.OrgID:
×
42
                return noneEmptyStringPointer(p.profile.OrgID()), nil
×
43
        case flag.Version:
×
44
                return noneEmptyStringPointer(p.profile.APIVersion()), nil
×
45
        }
46

47
        return nil, nil
×
48
}
49

50
func noneEmptyStringPointer(value string) *string {
×
51
        if value != "" {
×
52
                return pointer.Get(value)
×
53
        }
×
54

55
        return nil
×
56
}
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