Skip to content
This repository was archived by the owner on Mar 24, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
e4d513f
Add mattermost OAuth2 flow
ravishankar15 Aug 6, 2024
adfeb1f
Correcting the comments
ravishankar15 Aug 13, 2024
7a9aa2c
Fix the config checks API
ravishankar15 Aug 13, 2024
9b750b4
Fixing the lint errors
ravishankar15 Aug 13, 2024
a039a59
Add mattermost OAuth2 flow
ravishankar15 Aug 6, 2024
9126d1d
Mattermost Connect Channels
ravishankar15 Aug 27, 2024
726c80e
Addressed the review comments
ravishankar15 Aug 30, 2024
71588db
Adding default action and test cases
ravishankar15 Sep 7, 2024
5dc0afa
Review comments
ravishankar15 Sep 10, 2024
2712c29
Fix exception handling of mattermost API
ravishankar15 Sep 11, 2024
5225f2d
Make the feature flag true by default
ravishankar15 Sep 12, 2024
bcc3887
Review comments and changes for latest update on freature branch
ravishankar15 Sep 14, 2024
384a52a
Add token to base for testing
ravishankar15 Sep 14, 2024
2ff3a1d
Remove config checks from OrganizationConfigChecksView
ravishankar15 Sep 17, 2024
20bfd9a
Remove related config check code
ravishankar15 Sep 17, 2024
23d5bbe
Remove missed config check
ravishankar15 Sep 17, 2024
c06a792
Mattermost Channel Integration UI Changes
ravishankar15 Sep 18, 2024
f1b5b0f
Use channel id insted of channel name and team name
ravishankar15 Sep 19, 2024
e85ffb1
Review comments
ravishankar15 Sep 24, 2024
3abfab3
Update to emotion styling
ravishankar15 Oct 1, 2024
7c10ace
Mattermost User Integration
ravishankar15 Sep 20, 2024
ae20e64
Moving to emotion styling review comments
ravishankar15 Oct 1, 2024
6a101ce
Remove unnecessary unique index
ravishankar15 Oct 7, 2024
7e1c528
Mattermost Alert Flow
ravishankar15 Oct 14, 2024
5faec3c
Fix spelling
ravishankar15 Oct 16, 2024
058a60a
Adding tests and review comments
ravishankar15 Oct 31, 2024
a411d60
Fix duplication and lint fixes
ravishankar15 Nov 12, 2024
c4183d5
Add config for ci test
ravishankar15 Nov 12, 2024
95289d8
Address Review comments
ravishankar15 Nov 14, 2024
472c3c3
Fixing Lint and User auth redirect flow
ravishankar15 Nov 19, 2024
b2326ae
Mattermost incoming event handler
ravishankar15 Nov 20, 2024
4d69512
Review comments and tests
ravishankar15 Nov 21, 2024
dbd8f7f
User Notification and Escalation Chain flow
ravishankar15 Nov 26, 2024
9caf6b9
Save notification record and review comments
ravishankar15 Nov 30, 2024
0cb8cca
Remove print statement
ravishankar15 Dec 3, 2024
95c3928
Regenerate migrations
matiasb Dec 3, 2024
a3126fe
Documentation for mattermost integration
ravishankar15 Dec 4, 2024
4fca9b0
Update docs, fix lint
matiasb Dec 4, 2024
6136504
Add mattermost alert group integration flow
ravishankar15 Dec 7, 2024
93552d3
Add chatops display condition and review comments
ravishankar15 Dec 10, 2024
e7b4dfa
Minor updates and refactorings
matiasb Dec 27, 2024
1aaff07
Updates from review
matiasb Jan 3, 2025
d40c8fc
Update db migration
matiasb Jan 7, 2025
a104a9b
Updates post-rebase
matiasb Mar 3, 2025
53afedd
Upgrade django
matiasb Apr 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add mattermost OAuth2 flow
Settings Frontend flow

Change UI text for mattermost integration

OAuth login flow

OAuth Flow

Fix env status loading

Lint fixes
  • Loading branch information
ravishankar15 authored and matiasb committed Apr 21, 2025
commit a039a594407c3b63bae863803cd00fe5e51c4710
9 changes: 9 additions & 0 deletions engine/apps/api/serializers/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,23 @@ class Meta:
class CurrentOrganizationConfigChecksSerializer(serializers.ModelSerializer):
is_chatops_connected = serializers.SerializerMethodField()
is_integration_chatops_connected = serializers.SerializerMethodField()
mattermost = serializers.SerializerMethodField()

class Meta:
model = Organization
fields = [
"is_chatops_connected",
"is_integration_chatops_connected",
"mattermost",
]

def get_mattermost(self, obj):
env_status = not LiveSetting.objects.filter(name__startswith="MATTERMOST", error__isnull=False).exists()
return {
"env_status": env_status,
"is_integrated": False, # TODO: Add logic to verify if mattermost is integrated
}

def get_is_chatops_connected(self, obj):
msteams_backend = get_messaging_backend_from_id("MSTEAMS")
return bool(
Expand Down
8 changes: 8 additions & 0 deletions engine/apps/api/tests/test_organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@ def test_get_organization_slack_config_checks(
expected_result = {
"is_chatops_connected": False,
"is_integration_chatops_connected": False,
"mattermost": {
"env_status": True,
"is_integrated": False,
},
}
response = client.get(url, format="json", **make_user_auth_headers(user, token))
assert response.status_code == status.HTTP_200_OK
Expand Down Expand Up @@ -334,6 +338,10 @@ def test_get_organization_telegram_config_checks(
expected_result = {
"is_chatops_connected": False,
"is_integration_chatops_connected": False,
"mattermost": {
"env_status": True,
"is_integrated": False,
},
}
response = client.get(url, format="json", **make_user_auth_headers(user, token))
assert response.status_code == status.HTTP_200_OK
Expand Down
2 changes: 2 additions & 0 deletions grafana-plugin/src/models/base_store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export class BaseStore {

// Update env_status field for current team
await this.rootStore.organizationStore.loadCurrentOrganization();
await this.rootStore.organizationStore.loadCurrentOrganizationConfigChecks();
return result;
} catch (error) {
this.onApiError(error, skipErrorHandling);
Expand All @@ -103,6 +104,7 @@ export class BaseStore {
});
// Update env_status field for current team
await this.rootStore.organizationStore.loadCurrentOrganization();
await this.rootStore.organizationStore.loadCurrentOrganizationConfigChecks();
return result;
} catch (error) {
this.onApiError(error);
Expand Down
14 changes: 13 additions & 1 deletion grafana-plugin/src/models/organization/organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ import { BaseStore } from 'models/base_store';
import { makeRequest } from 'network/network';
import { RootStore } from 'state/rootStore';

import { Organization } from './organization.types';
import { Organization, OrganizationConfigChecks } from './organization.types';

export class OrganizationStore extends BaseStore {
@observable
currentOrganization?: Organization;

@observable
organizationConfigChecks?: OrganizationConfigChecks;

constructor(rootStore: RootStore) {
super(rootStore);
makeObservable(this);
Expand All @@ -25,6 +28,15 @@ export class OrganizationStore extends BaseStore {
});
}

@action.bound
async loadCurrentOrganizationConfigChecks() {
const organizationConfigChecks = await makeRequest(`${this.path}config-checks`, {});

runInAction(() => {
this.organizationConfigChecks = organizationConfigChecks;
});
}

async saveCurrentOrganization(data: Partial<Organization>) {
this.currentOrganization = await makeRequest(this.path, {
method: 'PUT',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,12 @@ export interface Organization {
mattermost_configured: boolean;
};
}

export interface OrganizationConfigChecks {
is_chatops_connected: boolean;
is_integration_chatops_connected: boolean;
mattermost: {
env_status: boolean;
is_integrated: boolean;
};
}
8 changes: 8 additions & 0 deletions grafana-plugin/src/pages/settings/tabs/ChatOps/ChatOps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ const Tabs = (props: TabsProps) => {
</Stack>
</VerticalTab>
)}
{store.hasFeature(AppFeature.Mattermost) && (
<VerticalTab id={ChatOpsTab.Mattermost}>
<HorizontalGroup>
<Icon name="message" />
Mattermost
</HorizontalGroup>
</VerticalTab>
)}
</VerticalTabsBar>
);
};
Expand Down
1 change: 1 addition & 0 deletions grafana-plugin/src/state/rootBaseStore/RootBaseStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export class RootBaseStore {
await retryFailingPromises([
() => this.userStore.loadCurrentUser(),
() => this.organizationStore.loadCurrentOrganization(),
() => this.organizationStore.loadCurrentOrganizationConfigChecks(),
() => this.grafanaTeamStore.updateItems(),
() => updateFeatures(),
() => this.alertReceiveChannelStore.fetchAlertReceiveChannelOptions(),
Expand Down