Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce plugin table #108

Merged
merged 14 commits into from
Nov 14, 2023
Merged

Introduce plugin table #108

merged 14 commits into from
Nov 14, 2023

Conversation

sukhwinder33445
Copy link
Contributor

@sukhwinder33445 sukhwinder33445 commented Oct 9, 2023

resolves #107

  • change upgrade schema name -- no change needed

@sukhwinder33445 sukhwinder33445 self-assigned this Oct 9, 2023
@cla-bot cla-bot bot added the cla/signed CLA is signed by all contributors of a PR label Oct 9, 2023
@sukhwinder33445 sukhwinder33445 changed the base branch from main to enhance-channel October 9, 2023 13:11
@sukhwinder33445 sukhwinder33445 force-pushed the introduce-plugin-table branch 2 times, most recently from af87177 to 7bac817 Compare October 10, 2023 08:52
@sukhwinder33445 sukhwinder33445 force-pushed the enhance-channel branch 2 times, most recently from aab13a9 to 806702e Compare October 10, 2023 10:11
@sukhwinder33445 sukhwinder33445 force-pushed the introduce-plugin-table branch 5 times, most recently from e8a319d to 8db1d1b Compare October 12, 2023 11:22
Base automatically changed from enhance-channel to main October 16, 2023 11:30
@sukhwinder33445 sukhwinder33445 force-pushed the introduce-plugin-table branch 2 times, most recently from c1ee4fd to 46cb339 Compare October 16, 2023 13:30
cmd/icinga-notifications-daemon/main.go Outdated Show resolved Hide resolved
internal/channel/plugin.go Outdated Show resolved Hide resolved
cmd/icinga-notifications-daemon/main.go Outdated Show resolved Hide resolved
cmd/icinga-notifications-daemon/main.go Outdated Show resolved Hide resolved
internal/channel/channel.go Outdated Show resolved Hide resolved
internal/incident/incident.go Outdated Show resolved Hide resolved
internal/channel/channel.go Outdated Show resolved Hide resolved
internal/channel/channel.go Outdated Show resolved Hide resolved
internal/channel/channel.go Outdated Show resolved Hide resolved
internal/channel/channel.go Outdated Show resolved Hide resolved
@sukhwinder33445 sukhwinder33445 force-pushed the introduce-plugin-table branch 3 times, most recently from 4e50f91 to 770caaa Compare October 19, 2023 10:38
Copy link
Collaborator

@julianbrost julianbrost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(So far, just the first round of findings, there'll probably be more comments in the future.)

schema/pgsql/upgrades/plugin_table.sql Outdated Show resolved Hide resolved
schema/pgsql/upgrades/plugin_table.sql Outdated Show resolved Hide resolved
cmd/channel/email/main.go Outdated Show resolved Hide resolved
cmd/channel/email/main.go Outdated Show resolved Hide resolved
internal/channel/channel.go Outdated Show resolved Hide resolved
internal/channel/plugin.go Outdated Show resolved Hide resolved
@sukhwinder33445 sukhwinder33445 force-pushed the introduce-plugin-table branch 3 times, most recently from c7474ff to ac79bb8 Compare October 25, 2023 09:59
Copy link
Member

@yhabteab yhabteab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know I'm not even good at this either, but please document at least the exported methods.

cmd/channel/email/main.go Show resolved Hide resolved
cmd/icinga-notifications-daemon/main.go Outdated Show resolved Hide resolved
internal/channel/plugin.go Outdated Show resolved Hide resolved
internal/channel/plugin.go Outdated Show resolved Hide resolved
internal/channel/plugin.go Outdated Show resolved Hide resolved
internal/channel/plugin.go Outdated Show resolved Hide resolved
internal/channel/channel.go Outdated Show resolved Hide resolved
internal/incident/incident.go Outdated Show resolved Hide resolved
pkg/plugin/plugin.go Outdated Show resolved Hide resolved
schema/pgsql/schema.sql Show resolved Hide resolved
Comment on lines 86 to 90
minValue := types.Int{NullInt64: sql.NullInt64{Int64: 0}}
minValue.Valid = true

maxValue := types.Int{NullInt64: sql.NullInt64{Int64: 65535}}
maxValue.Valid = true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just set Valid as well within the struct initializer (and then also move it into the initialization below so you don't need the extra variables).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: types.Int is buggy and ignores the omitempty flag.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if that's a bug of types.Int or just a limitation of encoding/json. Anyways, looks like it just writes null to the JSON then. Would that be a problem for the web module?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, Web can handle it.

pkg/plugin/plugin.go Outdated Show resolved Hide resolved
internal/channel/channel.go Outdated Show resolved Hide resolved
internal/channel/plugin.go Outdated Show resolved Hide resolved
pkg/plugin/plugin.go Outdated Show resolved Hide resolved
pkg/plugin/plugin.go Outdated Show resolved Hide resolved
- The Upsert() func is no longer required because Info{} contains all that properties.
- Fix reciver param name of Info.TableName() method.
- Remove type from GetInfo to make it non-configurable. The file name should always be used as the type.
@julianbrost julianbrost merged commit 6f4b437 into main Nov 14, 2023
2 checks passed
@julianbrost julianbrost deleted the introduce-plugin-table branch November 14, 2023 12:21
julianbrost added a commit that referenced this pull request Nov 14, 2023
only-new-issues seems to hide some issues even if they are introduced by a PR, i.e. leaving a struct field there but removing all usages of it. This can result in CI failures after merging, see #108 and 6f4b437 for example.
julianbrost added a commit that referenced this pull request Nov 14, 2023
only-new-issues seems to hide some issues even if they are introduced by a PR, i.e. leaving a struct field there but removing all usages of it. This can result in CI failures after merging, see #108 and 6f4b437 for example.
julianbrost added a commit that referenced this pull request Nov 14, 2023
only-new-issues seems to hide some issues in PRs even if they are introduced
there.  For example, removing all usages of a struct field without touching the
field itself is not detected. This can result in CI failures after merging,
see #108 and 6f4b437 for example.
julianbrost added a commit that referenced this pull request Nov 15, 2023
only-new-issues seems to hide some issues in PRs even if they are introduced
there.  For example, removing all usages of a struct field without touching the
field itself is not detected. This can result in CI failures after merging,
see #108 and 6f4b437 for example.
nilmerg added a commit to Icinga/icinga-notifications-web that referenced this pull request Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla/signed CLA is signed by all contributors of a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Query channel plugin information from all available plugins and write it to the database
4 participants