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

mendersoftware / deployments / 1197570064

01 Mar 2024 06:24PM UTC coverage: 52.222% (-28.4%) from 80.645%
1197570064

Pull #998

gitlab-ci

web-flow
chore: bump github.com/Azure/azure-sdk-for-go/sdk/azcore

Bumps [github.com/Azure/azure-sdk-for-go/sdk/azcore](https://github.com/Azure/azure-sdk-for-go) from 1.9.1 to 1.10.0.
- [Release notes](https://github.com/Azure/azure-sdk-for-go/releases)
- [Changelog](https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/release.md)
- [Commits](https://github.com/Azure/azure-sdk-for-go/compare/sdk/azcore/v1.9.1...sdk/azcore/v1.10.0)

---
updated-dependencies:
- dependency-name: github.com/Azure/azure-sdk-for-go/sdk/azcore
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #998: chore: bump github.com/Azure/azure-sdk-for-go/sdk/azcore from 1.9.1 to 1.10.0

5218 of 9992 relevant lines covered (52.22%)

0.55 hits per line

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

51.52
/store/mongo/migration_1_2_5.go
1
// Copyright 2023 Northern.tech AS
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
package mongo
15

16
import (
17
        "context"
18

19
        "github.com/mendersoftware/go-lib-micro/mongo/migrate"
20
        "go.mongodb.org/mongo-driver/mongo"
21
)
22

23
type migration_1_2_5 struct {
24
        client *mongo.Client
25
        db     string
26
}
27

28
func (m *migration_1_2_5) Up(from migrate.Version) error {
1✔
29
        ctx := context.Background()
1✔
30
        storage := NewDataStoreMongoWithClient(m.client)
1✔
31
        coll := m.client.Database(m.db).Collection(CollectionDevices)
1✔
32
        // Drop IndexDeploymentDeviceStatusesName and
1✔
33
        // IndexDeploymentDeviceDeploymentIdName if they exist.
1✔
34
        _, err := coll.Indexes().DropOne(ctx, IndexDeploymentDeviceStatusesName)
1✔
35
        if err != nil {
1✔
36
                if except, ok := err.(mongo.CommandError); ok {
×
37
                        if except.Code != errorCodeNamespaceNotFound &&
×
38
                                except.Code != errorCodeIndexNotFound {
×
39
                                return err
×
40
                        }
×
41
                        // continue
42
                } else {
×
43
                        return err
×
44
                }
×
45
        }
46
        _, err = coll.Indexes().DropOne(ctx, IndexDeploymentDeviceDeploymentIdName)
1✔
47
        if err != nil {
1✔
48
                if except, ok := err.(mongo.CommandError); ok {
×
49
                        if except.Code != errorCodeNamespaceNotFound &&
×
50
                                except.Code != errorCodeIndexNotFound {
×
51
                                return err
×
52
                        }
×
53
                        // continue
54
                } else {
×
55
                        return err
×
56
                }
×
57
        }
58
        return storage.EnsureIndexes(m.db, CollectionDevices,
1✔
59
                DeviceIDCreatedStatusIndex,
1✔
60
                DeploymentIdIndexes,
1✔
61
        )
1✔
62
}
63

64
func (m *migration_1_2_5) Version() migrate.Version {
1✔
65
        return migrate.MakeVersion(1, 2, 5)
1✔
66
}
1✔
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

© 2025 Coveralls, Inc