Commit graph

1972 commits

Author SHA1 Message Date
Alexander A. Klimov
47d0cbc0d9 Test types.NotificationType#Value() 2024-09-05 16:28:00 +02:00
Alexander A. Klimov
58f881e7b0 Test types.NotificationType#UnmarshalText() 2024-09-05 16:21:04 +02:00
Julian Brost
277a61d30e
Merge pull request #777 from Icinga/test-icingaredis
Test icingaredis.CreateEntities()
2024-08-09 17:01:28 +02:00
Julian Brost
71c6092595
Merge pull request #771 from Icinga/Al2Klimov-patch-4
GHA: also test MySQL 8
2024-08-09 17:01:12 +02:00
Julian Brost
f9ce7a57bc
Merge pull request #743 from Icinga/doc-03-systemd-journald-appendix
doc/03-Configuration.md: Logging Fields in Journald
2024-08-06 15:24:19 +02:00
Alexander A. Klimov
7f20cf2e33 Test icingaredis.CreateEntities() 2024-08-05 12:45:32 +02:00
Alvar Penning
813cf9fad6
doc/03-Configuration.md: Logging Fields in Journald
While working on an issue where the additional logging information
provided by zap fields was missing, I realized that our documentation
did not indicate how to view them. So a new documentation section has
been added explaining how to view the fields when using the
`systemd-journald` logging output.

Also removes one trailing space.
2024-08-05 10:50:23 +02:00
Julian Brost
9cde14e2d3
Merge pull request #779 from Icinga/schema-fixes-i724-i752
schema: Fix values to fit by increasing type sizes
2024-07-31 11:20:49 +02:00
Julian Brost
9946fa5902
Merge pull request #767 from Icinga/icingadb-migrate-null-name-i766
icingadb-migrate: Mitigate NULL names in {comment,downtime}_query
2024-07-31 10:29:16 +02:00
Julian Brost
56d83da406
Merge pull request #780 from Icinga/dependabot/go_modules/github.com/icinga/icinga-go-library-0.3.1
build(deps): bump github.com/icinga/icinga-go-library from 0.3.0 to 0.3.1
2024-07-31 10:15:14 +02:00
dependabot[bot]
38ac7c5a4c
build(deps): bump github.com/icinga/icinga-go-library
Bumps [github.com/icinga/icinga-go-library](https://github.com/icinga/icinga-go-library) from 0.3.0 to 0.3.1.
- [Commits](https://github.com/icinga/icinga-go-library/compare/v0.3.0...v0.3.1)

---
updated-dependencies:
- dependency-name: github.com/icinga/icinga-go-library
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-31 08:02:18 +00:00
Julian Brost
99c511d296
Merge pull request #760 from Icinga/doc-installing-icingadb-package-anchor
doc/02-Installation.md: Fix installing-icingadb-db-packages anchor
2024-07-30 17:08:26 +02:00
Julian Brost
0e3ffb167e
Merge pull request #774 from Icinga/dependabot/go_modules/tests/github.com/goccy/go-yaml-1.12.0
build(deps): bump github.com/goccy/go-yaml from 1.11.3 to 1.12.0 in /tests
2024-07-30 16:44:54 +02:00
Julian Brost
adf99d2d5c
Merge pull request #773 from Icinga/dependabot/go_modules/github.com/goccy/go-yaml-1.12.0
build(deps): bump github.com/goccy/go-yaml from 1.11.3 to 1.12.0
2024-07-30 16:30:59 +02:00
dependabot[bot]
fe34dbd7ae
build(deps): bump github.com/goccy/go-yaml in /tests
Bumps [github.com/goccy/go-yaml](https://github.com/goccy/go-yaml) from 1.11.3 to 1.12.0.
- [Release notes](https://github.com/goccy/go-yaml/releases)
- [Changelog](https://github.com/goccy/go-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/goccy/go-yaml/compare/v1.11.3...v1.12.0)

---
updated-dependencies:
- dependency-name: github.com/goccy/go-yaml
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-30 14:30:07 +00:00
Julian Brost
fc2c36be62
Merge pull request #765 from Icinga/dependabot/go_modules/github.com/jessevdk/go-flags-1.6.1
build(deps): bump github.com/jessevdk/go-flags from 1.5.0 to 1.6.1
2024-07-30 16:30:05 +02:00
Julian Brost
70392bc8d6
Merge pull request #778 from Icinga/dependabot/go_modules/tests/github.com/redis/go-redis/v9-9.6.1
build(deps): bump github.com/redis/go-redis/v9 from 9.5.1 to 9.6.1 in /tests
2024-07-30 16:28:58 +02:00
Alvar Penning
27d27d4539
schema: Fix values to fit by increasing type sizes
The icon_image_alt column in both the host and service tables contains
an image alt text. However, because it is defined as a varchar(32), many
alt texts do not fit. The type has been expanded to text, as with most
free text fields.

Closes #752.

When defining a TimePeriod, the maximum length of a range value was
capped at 255 characters. This limitation has now also been removed by
switching to the Text type.

Closes #724.

While re-reading the schema, I stumbled upon some missing
properties_checksum comments that were also added.
2024-07-30 10:38:19 +02:00
Julian Brost
80ef12b58c
Merge pull request #768 from Icinga/icingadb-migrate-check-env-id-length
icingadb-migrate: Verify env ID length
2024-07-30 09:55:16 +02:00
dependabot[bot]
f8aa458482
build(deps): bump github.com/goccy/go-yaml from 1.11.3 to 1.12.0
Bumps [github.com/goccy/go-yaml](https://github.com/goccy/go-yaml) from 1.11.3 to 1.12.0.
- [Release notes](https://github.com/goccy/go-yaml/releases)
- [Changelog](https://github.com/goccy/go-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/goccy/go-yaml/compare/v1.11.3...v1.12.0)

---
updated-dependencies:
- dependency-name: github.com/goccy/go-yaml
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-30 07:25:15 +00:00
dependabot[bot]
71ce079f11
build(deps): bump github.com/jessevdk/go-flags from 1.5.0 to 1.6.1
Bumps [github.com/jessevdk/go-flags](https://github.com/jessevdk/go-flags) from 1.5.0 to 1.6.1.
- [Release notes](https://github.com/jessevdk/go-flags/releases)
- [Commits](https://github.com/jessevdk/go-flags/compare/v1.5.0...v1.6.1)

---
updated-dependencies:
- dependency-name: github.com/jessevdk/go-flags
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-30 07:17:01 +00:00
dependabot[bot]
9b08923696
build(deps): bump github.com/redis/go-redis/v9 in /tests
Bumps [github.com/redis/go-redis/v9](https://github.com/redis/go-redis) from 9.5.1 to 9.6.1.
- [Release notes](https://github.com/redis/go-redis/releases)
- [Changelog](https://github.com/redis/go-redis/blob/master/CHANGELOG.md)
- [Commits](https://github.com/redis/go-redis/compare/v9.5.1...v9.6.1)

---
updated-dependencies:
- dependency-name: github.com/redis/go-redis/v9
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-25 18:23:48 +00:00
Julian Brost
b2203b90fb
Merge pull request #775 from Icinga/dependabot/go_modules/github.com/icinga/icinga-go-library-0.3.0
build(deps): bump github.com/icinga/icinga-go-library from 0.2.0 to 0.3.0
2024-07-23 15:59:20 +02:00
Julian Brost
f04fa03b9a build(deps): bump github.com/icinga/icinga-go-library
Icinga Go Library no longer uses the hard-coded project name "Icinga DB" when
printing the version, that name has to be given manually now.

Bumps [github.com/icinga/icinga-go-library](https://github.com/icinga/icinga-go-library) from 0.2.0 to 0.3.0.
- [Commits](https://github.com/icinga/icinga-go-library/compare/v0.2.0...v0.3.0)

---
updated-dependencies:
- dependency-name: github.com/icinga/icinga-go-library
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-23 15:27:41 +02:00
Alexander Aleksandrovič Klimov
7e6db393a6
GHA: also test MySQL 8 2024-07-12 16:37:03 +02:00
Alexander A. Klimov
b6839ce9f0 cmd/icingadb-migrate: replace magic number 20 with sha1.Size 2024-07-09 13:30:08 +00:00
Alvar Penning
b7483eb6f8
icingadb-migrate: Verify env ID length
An env ID with the wrong length, either due to a copy-paste error or
human error during testing, results in a SQL CHECK CONSTRAINT violation
that is retried multiple times until it finally fails.
2024-07-09 13:24:01 +02:00
Alvar Penning
59685cd623
icingadb-migrate: Mitigate NULL names in {comment,downtime}_query
Historical data from an older Icinga 2 installation contained NULL
values for the name column in some rows of the icinga_commenthistory and
icinga_downtimehistory tables.

Normally this field contains something like
${name1}!${name2}!${unique_value} where the $unique_value is based on a
timestamp for older entries and a UUID for newer ones. For a concrete
example, this could be "host.example.com!ping6!123…".

Unfortunately, using an empty string for these NULL values will cause an
error later because the new primary key will be calculated based on it.
Therefore, a new deterministic name is generated based on the primary
keys and the known name1 and name2 values.

Closes #766.
2024-07-09 13:05:36 +02:00
Julian Brost
6102d9cb2e
Merge pull request #761 from Icinga/dependabot/go_modules/github.com/icinga/icinga-go-library-0.2.0
build(deps): bump github.com/icinga/icinga-go-library from 0.1.0 to 0.2.0
2024-06-04 09:51:52 +02:00
dependabot[bot]
fe9aacbbe3
build(deps): bump github.com/icinga/icinga-go-library
Bumps [github.com/icinga/icinga-go-library](https://github.com/icinga/icinga-go-library) from 0.1.0 to 0.2.0.
- [Commits](https://github.com/icinga/icinga-go-library/compare/v0.1.0...v0.2.0)

---
updated-dependencies:
- dependency-name: github.com/icinga/icinga-go-library
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-03 18:45:36 +00:00
Alvar Penning
fe00e9bcbe
doc/02-Installation.md: Fix installing-icingadb-db-packages anchor
The anchor contains web, which is incorrect in this context.
2024-06-03 08:38:17 +02:00
Julian Brost
35c6b3f590
Merge pull request #747 from Icinga/library-split-2
Library split
2024-05-27 10:08:06 +02:00
Eric Lippmann
be4b450f5c Remove library code 2024-05-24 09:56:35 +02:00
Eric Lippmann
7c068d4adf Use icinga-go-library 2024-05-24 09:56:28 +02:00
Yonas Habteab
a016cc22ff Allow to dynamically define type constraint name 2024-05-23 12:42:28 +02:00
Eric Lippmann
cf90a395ac database: Introduce ColumnMap
`ColumnMap` provides a cached mapping of structs exported fields to
their database column names. By default, all exported struct fields are
mapped to their database column names using snake case notation. The `-`
(hyphen) directive for the db tag can be used to exclude certain fields.
Since `ColumnMap` uses cache, the returned slice MUST NOT be modified
directly.
2024-05-23 12:42:28 +02:00
Eric Lippmann
a73940e60a Introduce GetAddr() for database#DB and redis#Client 2024-05-23 12:42:28 +02:00
Eric Lippmann
b396a365e0 config#FromYAMLFile(): Parse result into value pointed to by the passed argument 2024-05-23 12:42:28 +02:00
Eric Lippmann
9f8354466a config#ParseFlags(): Parse result into value pointed to by the passed argument 2024-05-23 10:08:48 +02:00
Eric Lippmann
957e610508 Replace utils.Fatal() with utils.PrintErrorThenExit() 2024-05-23 09:46:25 +02:00
Eric Lippmann
1e221e4735 Refine types#UnixMilli tests 2024-05-22 11:51:22 +02:00
Eric Lippmann
5525c2085b types#UnixMilli.Scan(): Support uint64 2024-05-22 11:51:22 +02:00
Eric Lippmann
7f43a81369 types#UnixMilli.Scan(): Support []byte 2024-05-22 11:51:22 +02:00
Eric Lippmann
3569b35294 Fix types#UnixMilli.UnmarshalText() crashing on empty strings 2024-05-22 11:51:22 +02:00
Eric Lippmann
f3eeb61b54 Introduce contracts#SafeInit() 2024-05-22 11:51:22 +02:00
Eric Lippmann
647220ca8c Decouple structify from contracts 2024-05-22 11:51:22 +02:00
Eric Lippmann
7b73b8788a Introduce logging#NewLoggingFromConfig() 2024-05-22 11:51:22 +02:00
Eric Lippmann
43115e7c6c Don't set default port in redis 2024-05-22 11:51:22 +02:00
Eric Lippmann
c070615e64 Move Redis related code to redis 2024-05-22 11:51:22 +02:00
Eric Lippmann
3e63bbd068 Move internal/config#Retention to internal/config#RetentionConfig 2024-05-22 11:51:22 +02:00