Merge ~arturo-seijas/charm-k8s-mattermost:expose-max-channels-per-team-setting into charm-k8s-mattermost:master

Proposed by Arturo Enrique Seijas Fernández
Status: Merged
Approved by: Tom Haddon
Approved revision: 0f6418980f6626912e44f720c66bcc38724fe8ed
Merged at revision: 1876a15d85ae219a1c221b7db471524c171500d9
Proposed branch: ~arturo-seijas/charm-k8s-mattermost:expose-max-channels-per-team-setting
Merge into: charm-k8s-mattermost:master
Diff against target: 59 lines (+12/-0)
3 files modified
config.yaml (+5/-0)
src/charm.py (+1/-0)
tests/unit/test_charm.py (+6/-0)
Reviewer Review Type Date Requested Status
Tom Haddon Approve
Canonical IS Reviewers Pending
Review via email: mp+420253@code.launchpad.net

Commit message

Expose max channels per team setting (#1963643)

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Tom Haddon (mthaddon) wrote :

One comment inline.

Can we actually split this into two merge proposals?

One to add charmcraft.yaml and update the makefile so that `make test` still works as expected (note that it's relying on the presence of mattermost-k8s.charm which is no longer what will get created by charmcraft pack). And a second one with the config setting change and test update(s).

Thanks, Tom

review: Needs Fixing
Revision history for this message
Arturo Enrique Seijas Fernández (arturo-seijas) wrote :

> One comment inline.
>
> Can we actually split this into two merge proposals?
>
> One to add charmcraft.yaml and update the makefile so that `make test` still
> works as expected (note that it's relying on the presence of
> mattermost-k8s.charm which is no longer what will get created by charmcraft
> pack). And a second one with the config setting change and test update(s).
>
> Thanks, Tom

Done

Revision history for this message
Tom Haddon (mthaddon) wrote :

LGTM, thx

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 1876a15d85ae219a1c221b7db471524c171500d9

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/config.yaml b/config.yaml
2index fb5e1db..4cc4aea 100644
3--- a/config.yaml
4+++ b/config.yaml
5@@ -53,6 +53,11 @@ options:
6 description: |
7 The password associated with mattermost_image_username for accessing the registry specified in mattermost_image_path.
8 default: ''
9+ max_channels_per_team:
10+ type: int
11+ description: |
12+ Maximum number of channels per team, including both active and deleted channels.
13+ default: 3000
14 outbound_proxy:
15 type: string
16 description: The proxy to use for outbound requests.
17diff --git a/src/charm.py b/src/charm.py
18index 4ec1e8c..24393e7 100755
19--- a/src/charm.py
20+++ b/src/charm.py
21@@ -221,6 +221,7 @@ class MattermostK8sCharm(CharmBase):
22 'MM_LOGSETTINGS_CONSOLELEVEL': 'DEBUG' if config['debug'] else 'INFO',
23 'MM_LOGSETTINGS_ENABLECONSOLE': 'true',
24 'MM_LOGSETTINGS_ENABLEFILE': 'false',
25+ 'MM_TEAMSETTINGS_MAXCHANNELSPERTEAM': config['max_channels_per_team'],
26 }
27
28 if config['primary_team']:
29diff --git a/tests/unit/test_charm.py b/tests/unit/test_charm.py
30index 641258d..8e1d3d1 100644
31--- a/tests/unit/test_charm.py
32+++ b/tests/unit/test_charm.py
33@@ -106,6 +106,10 @@ CONFIG_LICENCE_REQUIRED_MIXED_INGRESS = {
34 'sso': False,
35 }
36
37+CONFIG_CHANNELS = {
38+ 'max_channels_per_team': 20,
39+}
40+
41
42 class TestMattermostK8sCharmHooksDisabled(unittest.TestCase):
43 def setUp(self):
44@@ -124,6 +128,7 @@ class TestMattermostK8sCharmHooksDisabled(unittest.TestCase):
45 def test_make_pod_config(self):
46 """Make pod config."""
47 self.harness.charm.state.db_uri = 'postgresql://10.0.1.101:5432/'
48+ self.harness.update_config(CONFIG_CHANNELS)
49 expected = {
50 'MATTERMOST_HTTPD_LISTEN_PORT': 8065,
51 'MM_CONFIG': 'postgres://10.0.1.101:5432/',
52@@ -134,6 +139,7 @@ class TestMattermostK8sCharmHooksDisabled(unittest.TestCase):
53 'MM_LOGSETTINGS_ENABLEFILE': 'false',
54 'MM_SERVICESETTINGS_SITEURL': 'http://mattermost-k8s',
55 'MM_SQLSETTINGS_DATASOURCE': 'postgres://10.0.1.101:5432/',
56+ 'MM_TEAMSETTINGS_MAXCHANNELSPERTEAM': 20,
57 }
58 self.assertEqual(self.harness.charm._make_pod_config(), expected)
59 # Now test with `primary_team` set.

Subscribers

People subscribed via source and target branches