From 39999fb4673ded4397bd0a72e96a6d4a7861b8b1 Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Fri, 31 Dec 2021 14:04:33 -0300 Subject: [PATCH 1/4] ci: enable stale GH action in place of stalebot Since stalebot appears to have been unreliable recently (https://github.com/probot/stale/issues/349), we can try to use GH Actions to manage the stale issues. --- .github/stale.yml | 63 ------------------------------------ .github/workflows/stale.yaml | 31 ++++++++++++++++++ 2 files changed, 31 insertions(+), 63 deletions(-) delete mode 100644 .github/stale.yml create mode 100644 .github/workflows/stale.yaml diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index 1e12f3b8d..000000000 --- a/.github/stale.yml +++ /dev/null @@ -1,63 +0,0 @@ -# Configuration for probot-stale - https://github.com/probot/stale - -# Number of days of inactivity before an Issue or Pull Request becomes stale -daysUntilStale: 7 - -# Number of days of inactivity before an Issue or Pull Request with the stale label is closed. -# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. -daysUntilClose: 7 - -# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled) -onlyLabels: [] - -# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable -exemptLabels: - - internal - - BUG - - "help wanted" - - "#triage/accepted" - - "#needs-triage" - -# Set to true to ignore issues in a project (defaults to false) -exemptProjects: false - -# Set to true to ignore issues in a milestone (defaults to false) -exemptMilestones: false - -# Set to true to ignore issues with an assignee (defaults to false) -exemptAssignees: false - -# Label to use when marking as stale -staleLabel: "#triage/stale" - -# Comment to post when marking as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. - -# Comment to post when removing the stale label. -# unmarkComment: > -# Your comment here. - -# Comment to post when closing a stale Issue or Pull Request. -# closeComment: > -# Your comment here. - -# Limit the number of actions per hour, from 1-30. Default is 30 -limitPerRun: 30 - -# Limit to only `issues` or `pulls` -only: issues - -# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls': -# pulls: -# daysUntilStale: 30 -# markComment: > -# This pull request has been automatically marked as stale because it has not had -# recent activity. It will be closed if no further activity occurs. Thank you -# for your contributions. - -# issues: -# exemptLabels: -# - confirmed diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml new file mode 100644 index 000000000..0be30117a --- /dev/null +++ b/.github/workflows/stale.yaml @@ -0,0 +1,31 @@ +--- + +name: Manage stale issues + +on: + schedule: + # run hourly + - cron: "0 * * * *" + workflow_dispatch: + +jobs: + stale: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: none + + steps: + - name: Close Stale Issues + uses: actions/stale@v4.1.0 + with: + days-before-stale: 7 + days-before-close: 7 + exempt-issue-labels: 'internal,BUG,help wanted,#triage/accepted,#needs-triage,Feature' + stale-issue-label: "#triage/stale" + stale-issue-message: >- + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. + +... From 377ed03a207e55d49c4944d5434038d2f42892c3 Mon Sep 17 00:00:00 2001 From: k32 <10274441+k32@users.noreply.github.com> Date: Mon, 3 Jan 2022 12:01:59 +0100 Subject: [PATCH 2/4] fix(system_monitor): Unify configuration with sysmon --- apps/emqx/src/emqx_schema.erl | 63 +++++++++++++++++++++++++ apps/emqx_conf/src/emqx_conf_schema.erl | 62 ------------------------ 2 files changed, 63 insertions(+), 62 deletions(-) diff --git a/apps/emqx/src/emqx_schema.erl b/apps/emqx/src/emqx_schema.erl index ee1457eef..52b2af9a9 100644 --- a/apps/emqx/src/emqx_schema.erl +++ b/apps/emqx/src/emqx_schema.erl @@ -868,6 +868,10 @@ fields("sysmon") -> sc(ref("sysmon_os"), #{}) } + , {"top", + sc(ref("sysmon_top"), + #{}) + } ]; fields("sysmon_vm") -> @@ -941,6 +945,65 @@ fields("sysmon_os") -> } ]; +fields("sysmon_top") -> + [ {"num_items", + sc(non_neg_integer(), + #{ mapping => "system_monitor.top_num_items" + , default => 10 + , desc => "The number of top processes per monitoring group" + }) + } + , {"sample_interval", + sc(emqx_schema:duration(), + #{ mapping => "system_monitor.top_sample_interval" + , default => "2s" + , desc => "Specifies how often process top should be collected" + }) + } + , {"max_procs", + sc(non_neg_integer(), + #{ mapping => "system_monitor.top_max_procs" + , default => 3000000 + , desc => "Stop collecting data when the number of processes +in the VM exceeds this value" + }) + } + , {"db_hostname", + sc(string(), + #{ mapping => "system_monitor.db_hostname" + , desc => "Hostname of the postgres database that collects the data points" + }) + } + , {"db_port", + sc(integer(), + #{ mapping => "system_monitor.db_port" + , default => 5432 + , desc => "Port of the postgres database that collects the data points" + }) + } + , {"db_username", + sc(string(), + #{ mapping => "system_monitor.db_username" + , default => "system_monitor" + , desc => "EMQX user name in the postgres database" + }) + } + , {"db_password", + sc(binary(), + #{ mapping => "system_monitor.db_password" + , default => "system_monitor_password" + , desc => "EMQX user password in the postgres database" + }) + } + , {"db_name", + sc(string(), + #{ mapping => "system_monitor.db_name" + , default => "postgres" + , desc => "Postgres database name" + }) + } + ]; + fields("alarm") -> [ {"actions", sc(hoconsc:array(atom()), diff --git a/apps/emqx_conf/src/emqx_conf_schema.erl b/apps/emqx_conf/src/emqx_conf_schema.erl index 1ea368826..b38834391 100644 --- a/apps/emqx_conf/src/emqx_conf_schema.erl +++ b/apps/emqx_conf/src/emqx_conf_schema.erl @@ -98,10 +98,6 @@ roots() -> sc(ref("db"), #{ desc => "Settings of the embedded database." })} - , {"system_monitor", - sc(ref("system_monitor"), - #{ desc => "Erlang process and application monitoring." - })} ] ++ emqx_schema:roots(medium) ++ emqx_schema:roots(low) ++ @@ -322,64 +318,6 @@ a crash dump )} ]; -fields("system_monitor") -> - [ {"top_num_items", - sc(non_neg_integer(), - #{ mapping => "system_monitor.top_num_items" - , default => 10 - , desc => "The number of top processes per monitoring group" - }) - } - , {"top_sample_interval", - sc(emqx_schema:duration(), - #{ mapping => "system_monitor.top_sample_interval" - , default => "2s" - , desc => "Specifies how often process top should be collected" - }) - } - , {"top_max_procs", - sc(non_neg_integer(), - #{ mapping => "system_monitor.top_max_procs" - , default => 200000 - , desc => "Stop collecting data when the number of processes exceeds this value" - }) - } - , {"db_hostname", - sc(string(), - #{ mapping => "system_monitor.db_hostname" - , desc => "Hostname of the postgres database that collects the data points" - }) - } - , {"db_port", - sc(integer(), - #{ mapping => "system_monitor.db_port" - , default => 5432 - , desc => "Port of the postgres database that collects the data points" - }) - } - , {"db_username", - sc(string(), - #{ mapping => "system_monitor.db_username" - , default => "system_monitor" - , desc => "EMQX user name in the postgres database" - }) - } - , {"db_password", - sc(binary(), - #{ mapping => "system_monitor.db_password" - , default => "system_monitor_password" - , desc => "EMQX user password in the postgres database" - }) - } - , {"db_name", - sc(string(), - #{ mapping => "system_monitor.db_name" - , default => "postgres" - , desc => "Postgres database name" - }) - } - ]; - fields("db") -> [ {"backend", sc(hoconsc:enum([mnesia, rlog]), From 1d7125630578f184f2d87eb17786e764a342b0ee Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Mon, 3 Jan 2022 10:02:59 -0300 Subject: [PATCH 3/4] chore(deps): update mix.lock (mongodb) --- mix.lock | 2 +- scripts/check-elixir-deps-discrepancies.exs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mix.lock b/mix.lock index 460eef4a7..051dbc72b 100644 --- a/mix.lock +++ b/mix.lock @@ -31,7 +31,7 @@ "lc": {:git, "https://github.com/qzhuyan/lc.git", "6f98d098e5aaf4fcd6afbbb2acca96855c474600", [tag: "0.1.2"]}, "minirest": {:git, "https://github.com/emqx/minirest.git", "f3f80b3e07295d8b6db22ed456318e0cc9dd167f", [tag: "1.2.7"]}, "mnesia_rocksdb": {:git, "https://github.com/k32/mnesia_rocksdb", "68a80d127c49005480e0dd1f73149e8621052100", [tag: "0.1.5-k32"]}, - "mongodb": {:git, "https://github.com/emqx/mongodb-erlang", "2ffe62f42dafb98eaafead9d340a674c5f9279a5", [tag: "v3.0.10"]}, + "mongodb": {:git, "https://github.com/emqx/mongodb-erlang", "7c6d6fcd562c0b9c88e123ee1cf5ed0b97d0f3ac", [tag: "v3.0.11"]}, "mria": {:git, "https://github.com/emqx/mria.git", "2bf3a71abc3635f910be4b943fa4ccbf8b8257fa", [tag: "0.1.5"]}, "mysql": {:git, "https://github.com/emqx/mysql-otp", "bdabac44cc8836a9e23897b7e1b77c7df7e04f70", [tag: "1.7.1"]}, "observer_cli": {:hex, :observer_cli, "1.7.1", "c9ca1f623a3ef0158283a3c37cd7b7235bfe85927ad6e26396dd247e2057f5a1", [:mix, :rebar3], [{:recon, "~>2.5.1", [hex: :recon, repo: "hexpm", optional: false]}], "hexpm", "4ccafaaa2ce01b85ddd14591f4d5f6731b4e13b610a70fb841f0701178478280"}, diff --git a/scripts/check-elixir-deps-discrepancies.exs b/scripts/check-elixir-deps-discrepancies.exs index 21a2d18ef..eee0a9e67 100755 --- a/scripts/check-elixir-deps-discrepancies.exs +++ b/scripts/check-elixir-deps-discrepancies.exs @@ -100,7 +100,8 @@ else IO.puts( IO.ANSI.red() <> - "Update `mix.exs` to match Rebar3's references (use `overwrite: true` if necessary) and try again" <> + "Update `mix.exs` to match Rebar3's references (use `overwrite: true` if necessary) " <> + "and/or run `mix deps.get` to update and try again" <> IO.ANSI.reset() ) From b98a00c35d196058cb1a4b6c6c13b072cb298d02 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Fri, 31 Dec 2021 10:08:16 +0100 Subject: [PATCH 4/4] ci: run dialyzer check on self-hosted runner --- .github/workflows/run_static_checks.yaml | 23 +++++++++++++++++++++++ .github/workflows/run_test_cases.yaml | 16 ---------------- 2 files changed, 23 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/run_static_checks.yaml diff --git a/.github/workflows/run_static_checks.yaml b/.github/workflows/run_static_checks.yaml new file mode 100644 index 000000000..b30097823 --- /dev/null +++ b/.github/workflows/run_static_checks.yaml @@ -0,0 +1,23 @@ +name: Run static checks + +concurrency: + group: static-check-${{ github.event_name }}-${{ github.ref }} + cancel-in-progress: true + +on: + push: + tags: + - v* + - e* + pull_request: + +jobs: + run_static_analysis: + runs-on: self-hosted + container: "ghcr.io/emqx/emqx-builder/5.0-3:24.1.5-3-alpine3.14" + steps: + - uses: actions/checkout@v2 + - name: xref + run: make xref + - name: dialyzer + run: make dialyzer diff --git a/.github/workflows/run_test_cases.yaml b/.github/workflows/run_test_cases.yaml index a88d6888b..2da627366 100644 --- a/.github/workflows/run_test_cases.yaml +++ b/.github/workflows/run_test_cases.yaml @@ -12,22 +12,6 @@ on: pull_request: jobs: - run_static_analysis: - strategy: - matrix: - emqx_builder: - - 5.0-3:24.1.5-3 # run dialyzer on latest OTP - - runs-on: ubuntu-20.04 - container: "ghcr.io/emqx/emqx-builder/${{ matrix.emqx_builder }}-ubuntu20.04" - - steps: - - uses: actions/checkout@v2 - - name: xref - run: make xref - - name: dialyzer - run: make dialyzer - run_proper_test: strategy: matrix: