From 70903de8792dc3b1470c845994a0180f04b81f68 Mon Sep 17 00:00:00 2001 From: Mike Ball Date: Thu, 3 Feb 2022 12:04:55 -0500 Subject: [PATCH 01/24] [wip] support 'splunk.com/on-call-routing-key' annotation Extends the Splunk On Call plugin Entity card to infer the corresponding team names from a `splunk.com/on-call-routing-key` annotation. This seeks to enable the use of the Splunk On Call plugin on entity pages for those orgs who associate a component with a routing key rather than a team name. Signed-off-by: Mike Ball --- plugins/splunk-on-call/src/api/client.ts | 11 ++++ plugins/splunk-on-call/src/api/types.ts | 11 ++++ .../src/components/EntitySplunkOnCallCard.tsx | 53 ++++++++++++++++--- .../splunk-on-call/src/components/types.ts | 12 +++++ 4 files changed, 79 insertions(+), 8 deletions(-) diff --git a/plugins/splunk-on-call/src/api/client.ts b/plugins/splunk-on-call/src/api/client.ts index 437c6365ed..6c0ff9bdc4 100644 --- a/plugins/splunk-on-call/src/api/client.ts +++ b/plugins/splunk-on-call/src/api/client.ts @@ -19,6 +19,7 @@ import { OnCall, User, EscalationPolicyInfo, + RoutingKey, Team, } from '../components/types'; import { @@ -30,6 +31,7 @@ import { RequestOptions, ListUserResponse, EscalationPolicyResponse, + ListRoutingKeyResponse, } from './types'; import { createApiRef, @@ -82,6 +84,15 @@ export class SplunkOnCallClient implements SplunkOnCallApi { return teams; } + async getRoutingKeys(): Promise { + const url = `${await this.config.discoveryApi.getBaseUrl( + 'proxy', + )}/splunk-on-call/v1/org/routing-keys`; + const { routingKeys } = await this.getByUrl(url); + + return routingKeys; + } + async getUsers(): Promise { const url = `${await this.config.discoveryApi.getBaseUrl( 'proxy', diff --git a/plugins/splunk-on-call/src/api/types.ts b/plugins/splunk-on-call/src/api/types.ts index 0bdd093ad1..6a414d18bd 100644 --- a/plugins/splunk-on-call/src/api/types.ts +++ b/plugins/splunk-on-call/src/api/types.ts @@ -18,6 +18,7 @@ import { EscalationPolicyInfo, Incident, OnCall, + RoutingKey, Team, User, } from '../components/types'; @@ -65,6 +66,11 @@ export interface SplunkOnCallApi { */ getTeams(): Promise; + /** + * Get a list of routing keys for your organization. + */ + getRoutingKeys(): Promise; + /** * Get a list of escalation policies for your organization. */ @@ -80,6 +86,11 @@ export type ListUserResponse = { _selfUrl?: string; }; +export type ListRoutingKeyResponse = { + routingKeys: RoutingKey[]; + _selfUrl?: string; +}; + export type IncidentsResponse = { incidents: Incident[]; }; diff --git a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx index bca53a3b0a..ef4ad0388b 100644 --- a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx +++ b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx @@ -45,9 +45,18 @@ import { } from '@backstage/core-components'; export const SPLUNK_ON_CALL_TEAM = 'splunk.com/on-call-team'; +export const SPLUNK_ON_CALL_ROUTING_KEY = 'splunk.com/on-call-routing-key'; -export const MissingTeamAnnotation = () => ( - +export const MissingAnnotation = () => ( +
+ + The Splunk On Call plugin requires setting either the{' '} + {SPLUNK_ON_CALL_TEAM} or the{' '} + {SPLUNK_ON_CALL_ROUTING_KEY} annotation. + + + +
); export const InvalidTeamAnnotation = ({ teamName }: { teamName: string }) => ( @@ -71,7 +80,8 @@ export const MissingEventsRestEndpoint = () => ( ); export const isSplunkOnCallAvailable = (entity: Entity) => - Boolean(entity.metadata.annotations?.[SPLUNK_ON_CALL_TEAM]); + Boolean(entity.metadata.annotations?.[SPLUNK_ON_CALL_TEAM]) || + Boolean(entity.metadata.annotations?.[SPLUNK_ON_CALL_ROUTING_KEY]); export const EntitySplunkOnCallCard = () => { const config = useApi(configApiRef); @@ -79,7 +89,12 @@ export const EntitySplunkOnCallCard = () => { const { entity } = useEntity(); const [showDialog, setShowDialog] = useState(false); const [refreshIncidents, setRefreshIncidents] = useState(false); - const team = entity.metadata.annotations![SPLUNK_ON_CALL_TEAM]; + const teamAnnotation = entity + ? entity.metadata.annotations![SPLUNK_ON_CALL_TEAM] + : undefined; + const routingKeyAnnotation = entity + ? entity.metadata.annotations![SPLUNK_ON_CALL_ROUTING_KEY] + : undefined; const eventsRestEndpoint = config.getOptionalString('splunkOnCall.eventsRestEndpoint') || null; @@ -108,7 +123,20 @@ export const EntitySplunkOnCallCard = () => { {}, ); const teams = await api.getTeams(); - const foundTeam = teams.find(teamValue => teamValue.name === team); + let foundTeam = teams.find(teamValue => teamValue.name === teamAnnotation); + + if (!foundTeam && routingKeyAnnotation) { + const routingKeys = await api.getRoutingKeys(); + const foundRoutingKey = routingKeys.find( + key => key.routingKey === routingKeyAnnotation, + ); + const teamUrlParts = foundRoutingKey + ? foundRoutingKey.targets[0]._teamUrl.split('/') + : []; + const teamSlug = teamUrlParts[teamUrlParts.length - 1]; + foundTeam = teams.find(teamValue => teamValue.slug === teamSlug); + } + return { usersHashMap, foundTeam }; }); @@ -128,13 +156,22 @@ export const EntitySplunkOnCallCard = () => { return ; } + const team = + usersAndTeam?.foundTeam && usersAndTeam?.foundTeam.name + ? usersAndTeam?.foundTeam.name + : ''; + const Content = () => { - if (!team) { - return ; + if (!teamAnnotation && !routingKeyAnnotation) { + return ; } if (!usersAndTeam?.foundTeam) { - return ; + return ( + + ); } if (!eventsRestEndpoint) { diff --git a/plugins/splunk-on-call/src/components/types.ts b/plugins/splunk-on-call/src/components/types.ts index 3c1902e52b..0feefe8b03 100644 --- a/plugins/splunk-on-call/src/components/types.ts +++ b/plugins/splunk-on-call/src/components/types.ts @@ -117,3 +117,15 @@ export type EscalationPolicyTeam = { name: string; slug: string; }; + +export type RoutingKey = { + routingKey: string; + targets: RoutingKeyTarget[]; + isDefault: boolean; +}; + +export type RoutingKeyTarget = { + policyName: string; + policySlug: string; + _teamUrl: string; +}; From 4c61bc0cfa73bdd65467a65a7da1d38bca1245b6 Mon Sep 17 00:00:00 2001 From: Mike Ball Date: Thu, 3 Feb 2022 16:08:22 -0500 Subject: [PATCH 02/24] render Splunk On-Call card per team In instances where a `splunk.com/on-call-routing-key` is provided and that routing key is associated with multiple teams, the component now renders an individual Splunk On-Call card for each team. Signed-off-by: Mike Ball --- .../src/components/EntitySplunkOnCallCard.tsx | 89 +++++++++++-------- 1 file changed, 52 insertions(+), 37 deletions(-) diff --git a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx index ef4ad0388b..1d3e639910 100644 --- a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx +++ b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx @@ -32,8 +32,7 @@ import { MissingApiKeyOrApiIdError } from './Errors/MissingApiKeyOrApiIdError'; import { EscalationPolicy } from './Escalation'; import { Incidents } from './Incident'; import { TriggerDialog } from './TriggerDialog'; -import { User } from './types'; - +import { Team, User } from './types'; import { configApiRef, useApi } from '@backstage/core-plugin-api'; import { @@ -108,7 +107,7 @@ export const EntitySplunkOnCallCard = () => { }, []); const { - value: usersAndTeam, + value: usersAndTeams, loading, error, } = useAsync(async () => { @@ -123,21 +122,26 @@ export const EntitySplunkOnCallCard = () => { {}, ); const teams = await api.getTeams(); - let foundTeam = teams.find(teamValue => teamValue.name === teamAnnotation); + let foundTeams = [ + teams.find(teamValue => teamValue.name === teamAnnotation), + ].filter(team => team !== undefined); - if (!foundTeam && routingKeyAnnotation) { + if (!foundTeams.length && routingKeyAnnotation) { const routingKeys = await api.getRoutingKeys(); const foundRoutingKey = routingKeys.find( key => key.routingKey === routingKeyAnnotation, ); - const teamUrlParts = foundRoutingKey - ? foundRoutingKey.targets[0]._teamUrl.split('/') + foundTeams = foundRoutingKey + ? foundRoutingKey.targets.map(target => { + const teamUrlParts = target._teamUrl.split('/'); + const teamSlug = teamUrlParts[teamUrlParts.length - 1]; + + return teams.find(teamValue => teamValue.slug === teamSlug); + }) : []; - const teamSlug = teamUrlParts[teamUrlParts.length - 1]; - foundTeam = teams.find(teamValue => teamValue.slug === teamSlug); } - return { usersHashMap, foundTeam }; + return { usersHashMap, foundTeams }; }); if (error instanceof UnauthorizedError) { @@ -156,17 +160,18 @@ export const EntitySplunkOnCallCard = () => { return ; } - const team = - usersAndTeam?.foundTeam && usersAndTeam?.foundTeam.name - ? usersAndTeam?.foundTeam.name - : ''; - - const Content = () => { + const Content = ({ + team, + usersHashMap, + }: { + team: Team | undefined; + usersHashMap: any | undefined; + }) => { if (!teamAnnotation && !routingKeyAnnotation) { return ; } - if (!usersAndTeam?.foundTeam) { + if (!team) { return ( { return ; } + const teamName = team.name || ''; + return ( <> - - {usersAndTeam?.usersHashMap && team && ( - + + {usersHashMap && team && ( + )} { icon: , }; + const teams = usersAndTeams?.foundTeams || []; + return ( - - Team: {team}, - , - ]} - /> - - - - - + <> + {teams.map((team, i) => ( + + + Team: {team && team.name ? team.name : ''} + , + , + ]} + /> + + + + + + ))} + ); }; From 0dfbb30a5db99afd6a209ad76b978eb12a75ddb4 Mon Sep 17 00:00:00 2001 From: Mike Ball Date: Thu, 3 Feb 2022 16:33:18 -0500 Subject: [PATCH 03/24] add 1em spacing between each Splunk On-Call card Signed-off-by: Mike Ball --- .../src/components/EntitySplunkOnCallCard.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx index 1d3e639910..8dbbf6e848 100644 --- a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx +++ b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx @@ -22,6 +22,7 @@ import { CardContent, CardHeader, Divider, + makeStyles, Typography, } from '@material-ui/core'; import AlarmAddIcon from '@material-ui/icons/AlarmAdd'; @@ -82,7 +83,14 @@ export const isSplunkOnCallAvailable = (entity: Entity) => Boolean(entity.metadata.annotations?.[SPLUNK_ON_CALL_TEAM]) || Boolean(entity.metadata.annotations?.[SPLUNK_ON_CALL_ROUTING_KEY]); +const useStyles = makeStyles({ + onCallCard: { + marginBottom: '1em', + }, +}); + export const EntitySplunkOnCallCard = () => { + const classes = useStyles(); const config = useApi(configApiRef); const api = useApi(splunkOnCallApiRef); const { entity } = useEntity(); @@ -219,7 +227,7 @@ export const EntitySplunkOnCallCard = () => { return ( <> {teams.map((team, i) => ( - + Date: Thu, 3 Feb 2022 16:45:42 -0500 Subject: [PATCH 04/24] properly render components Corrects logic ensuring `` and `` render correctly. Previously, neither component would render from within the `` component. Signed-off-by: Mike Ball --- .../src/components/EntitySplunkOnCallCard.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx index 8dbbf6e848..5f9db7e415 100644 --- a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx +++ b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx @@ -152,6 +152,14 @@ export const EntitySplunkOnCallCard = () => { return { usersHashMap, foundTeams }; }); + if (!teamAnnotation && !routingKeyAnnotation) { + return ; + } + + if (!eventsRestEndpoint) { + return ; + } + if (error instanceof UnauthorizedError) { return ; } @@ -175,10 +183,6 @@ export const EntitySplunkOnCallCard = () => { team: Team | undefined; usersHashMap: any | undefined; }) => { - if (!teamAnnotation && !routingKeyAnnotation) { - return ; - } - if (!team) { return ( { ); } - if (!eventsRestEndpoint) { - return ; - } - const teamName = team.name || ''; return ( From f408cabe8f93bdc828e661c3fb75bde42c309bf4 Mon Sep 17 00:00:00 2001 From: Mike Ball Date: Thu, 3 Feb 2022 17:09:17 -0500 Subject: [PATCH 05/24] handle invalid Splunk On-Call annotations If a `splunk.com/on-call-team` annotation is provided and the API returns no associated team, render... ``` Splunk On-Call API returned no record of teams associated with the "foo" team name Escalation Policy and incident information unavailable. Splunk On-Call requires a valid team name or routing key. ``` If a `splunk.com/on-call-routing-key` annotation is provided and the API returns no associated team, render... ``` Splunk On-Call API returned no record of teams associated with the "foo" routing key Escalation Policy and incident information unavailable. Splunk On-Call requires a valid team name or routing key. ``` Signed-off-by: Mike Ball --- .../src/components/EntitySplunkOnCallCard.tsx | 60 +++++++++++++------ 1 file changed, 41 insertions(+), 19 deletions(-) diff --git a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx index 5f9db7e415..559f7c551e 100644 --- a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx +++ b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx @@ -59,15 +59,36 @@ export const MissingAnnotation = () => ( ); -export const InvalidTeamAnnotation = ({ teamName }: { teamName: string }) => ( - - - -); +export const InvalidAnnotation = ({ + teamName, + routingKey, +}: { + teamName: string | undefined; + routingKey: string | undefined; +}) => { + let titleSuffix = 'provided annotation'; + + if (teamName) { + titleSuffix = `"${teamName}" team name`; + } + + if (routingKey) { + titleSuffix = `"${routingKey}" routing key`; + } + + return ( + + + + + + + ); +}; export const MissingEventsRestEndpoint = () => ( @@ -181,17 +202,9 @@ export const EntitySplunkOnCallCard = () => { usersHashMap, }: { team: Team | undefined; - usersHashMap: any | undefined; + usersHashMap: any; }) => { - if (!team) { - return ( - - ); - } - - const teamName = team.name || ''; + const teamName = team && team.name ? team.name : ''; return ( <> @@ -224,6 +237,15 @@ export const EntitySplunkOnCallCard = () => { const teams = usersAndTeams?.foundTeams || []; + if (!teams.length) { + return ( + + ); + } + return ( <> {teams.map((team, i) => ( From 7fa7857d4885bea7ef3dcfca9179c9dee1d88f0b Mon Sep 17 00:00:00 2001 From: Mike Ball Date: Thu, 3 Feb 2022 18:51:06 -0500 Subject: [PATCH 06/24] correct incorrect team annotation test Signed-off-by: Mike Ball --- .../src/components/EntitySplunkOnCallCard.test.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx index eb5c99d4e7..da2cfbc2a3 100644 --- a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx +++ b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx @@ -170,7 +170,9 @@ describe('SplunkOnCallCard', () => { ); await waitFor(() => !queryByTestId('progress')); expect( - getByText('Could not find team named "test" in the Splunk On-Call API'), + getByText( + 'Splunk On-Call API returned no record of teams associated with the "test" team name', + ), ).toBeInTheDocument(); }); From 4bda7d3045e7d36ce9a9fb87a3a24c74117724a8 Mon Sep 17 00:00:00 2001 From: Mike Ball Date: Thu, 3 Feb 2022 20:03:43 -0500 Subject: [PATCH 07/24] test warning for incorrect routing key annotation This adds a test asserting that the correct component is rendered when the entity `splunk.com/on-call-routing-key` does not properly map to any associated teams. Signed-off-by: Mike Ball --- plugins/splunk-on-call/src/api/mocks.ts | 13 ++++++ .../EntitySplunkOnCallCard.test.tsx | 41 +++++++++++++++++++ .../src/components/EntitySplunkOnCallCard.tsx | 30 +++++++------- 3 files changed, 70 insertions(+), 14 deletions(-) diff --git a/plugins/splunk-on-call/src/api/mocks.ts b/plugins/splunk-on-call/src/api/mocks.ts index d5335bfef4..8db06fb9d3 100644 --- a/plugins/splunk-on-call/src/api/mocks.ts +++ b/plugins/splunk-on-call/src/api/mocks.ts @@ -17,6 +17,7 @@ import { EscalationPolicyInfo, Incident, + RoutingKey, Team, User, } from '../components/types'; @@ -88,6 +89,18 @@ export const MOCK_TEAM: Team = { isDefaultTeam: false, }; +export const MOCK_ROUTING_KEY: RoutingKey = { + routingKey: 'test-routing-key', + targets: [ + { + policyName: 'some policy', + policySlug: MOCK_TEAM.slug || '', + _teamUrl: `/api-public/v1/team/${MOCK_TEAM.slug}`, + }, + ], + isDefault: false, +}; + export const MOCK_TEAM_NO_INCIDENTS: Team = { ...MOCK_TEAM, name: 'test-noincidents', diff --git a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx index da2cfbc2a3..8b58af8e46 100644 --- a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx +++ b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx @@ -28,6 +28,7 @@ import { MOCKED_ON_CALL, MOCKED_USER, MOCK_INCIDENT, + MOCK_ROUTING_KEY, MOCK_TEAM, MOCK_TEAM_NO_INCIDENTS, } from '../api/mocks'; @@ -45,6 +46,7 @@ const mockSplunkOnCallApi: Partial = { getIncidents: async () => [MOCK_INCIDENT], getOnCallUsers: async () => MOCKED_ON_CALL, getTeams: async () => [MOCK_TEAM], + getRoutingKeys: async () => [MOCK_ROUTING_KEY], getEscalationPolicies: async () => ESCALATION_POLICIES, }; @@ -71,6 +73,17 @@ const mockEntity = { }, } as Entity; +const mockEntityWithRoutingKeyAnnotation = { + apiVersion: 'backstage.io/v1alpha1', + kind: 'Component', + metadata: { + name: 'splunkoncall-test', + annotations: { + 'splunk.com/on-call-routing-key': MOCK_ROUTING_KEY.routingKey, + }, + }, +} as Entity; + const mockEntityNoIncidents = { apiVersion: 'backstage.io/v1alpha1', kind: 'Component', @@ -176,6 +189,34 @@ describe('SplunkOnCallCard', () => { ).toBeInTheDocument(); }); + it('handles warning for incorrect routing key annotation', async () => { + mockSplunkOnCallApi.getUsers = jest + .fn() + .mockImplementationOnce(async () => [MOCKED_USER]); + mockSplunkOnCallApi.getRoutingKeys = jest + .fn() + .mockImplementationOnce(async () => [MOCK_ROUTING_KEY]); + mockSplunkOnCallApi.getTeams = jest + .fn() + .mockImplementationOnce(async () => []); + + const { getByText, queryByTestId } = render( + wrapInTestApp( + + + + + , + ), + ); + await waitFor(() => !queryByTestId('progress')); + expect( + getByText( + `Splunk On-Call API returned no record of teams associated with the "${MOCK_ROUTING_KEY.routingKey}" routing key`, + ), + ).toBeInTheDocument(); + }); + it('opens the dialog when trigger button is clicked', async () => { mockSplunkOnCallApi.getUsers = jest .fn() diff --git a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx index 559f7c551e..db479f9459 100644 --- a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx +++ b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx @@ -161,12 +161,14 @@ export const EntitySplunkOnCallCard = () => { key => key.routingKey === routingKeyAnnotation, ); foundTeams = foundRoutingKey - ? foundRoutingKey.targets.map(target => { - const teamUrlParts = target._teamUrl.split('/'); - const teamSlug = teamUrlParts[teamUrlParts.length - 1]; + ? foundRoutingKey.targets + .map(target => { + const teamUrlParts = target._teamUrl.split('/'); + const teamSlug = teamUrlParts[teamUrlParts.length - 1]; - return teams.find(teamValue => teamValue.slug === teamSlug); - }) + return teams.find(teamValue => teamValue.slug === teamSlug); + }) + .filter(team => team !== undefined) : []; } @@ -197,6 +199,15 @@ export const EntitySplunkOnCallCard = () => { return ; } + if (!usersAndTeams?.foundTeams || !usersAndTeams?.foundTeams.length) { + return ( + + ); + } + const Content = ({ team, usersHashMap, @@ -237,15 +248,6 @@ export const EntitySplunkOnCallCard = () => { const teams = usersAndTeams?.foundTeams || []; - if (!teams.length) { - return ( - - ); - } - return ( <> {teams.map((team, i) => ( From 07ffc7ca9d2a0edeba69c4a86d50afa09e77852d Mon Sep 17 00:00:00 2001 From: Mike Ball Date: Thu, 3 Feb 2022 20:19:36 -0500 Subject: [PATCH 08/24] test when no Splunk On Call annotations are provided Signed-off-by: Mike Ball --- .../EntitySplunkOnCallCard.test.tsx | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx index 8b58af8e46..05d9a071c3 100644 --- a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx +++ b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx @@ -84,6 +84,15 @@ const mockEntityWithRoutingKeyAnnotation = { }, } as Entity; +const mockEntityNoAnnotation = { + apiVersion: 'backstage.io/v1alpha1', + kind: 'Component', + metadata: { + name: 'splunkoncall-test', + annotations: {}, + }, +} as Entity; + const mockEntityNoIncidents = { apiVersion: 'backstage.io/v1alpha1', kind: 'Component', @@ -164,6 +173,20 @@ describe('SplunkOnCallCard', () => { ).toBeInTheDocument(); }); + it('handles warning for missing required annotations', async () => { + const { getAllByText, queryByTestId } = render( + wrapInTestApp( + + + + + , + ), + ); + await waitFor(() => !queryByTestId('progress')); + expect(getAllByText('Missing Annotation').length).toEqual(2); + }); + it('handles warning for incorrect team annotation', async () => { mockSplunkOnCallApi.getUsers = jest .fn() From 5669e32ac1ac5494eb4273ae516a673422687096 Mon Sep 17 00:00:00 2001 From: Mike Ball Date: Thu, 3 Feb 2022 20:30:09 -0500 Subject: [PATCH 09/24] test component rendering w/ new annotation Test that the Splunk On Call component properly renders when a `splunk.com/on-call-routing-key` annotation is used. Signed-off-by: Mike Ball --- .../EntitySplunkOnCallCard.test.tsx | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx index 05d9a071c3..9c16752421 100644 --- a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx +++ b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx @@ -131,6 +131,35 @@ describe('SplunkOnCallCard', () => { expect(getByText('Empty escalation policy')).toBeInTheDocument(); }); + it('handles a "splunk.com/on-call-routing-key" annotation', async () => { + mockSplunkOnCallApi.getUsers = jest + .fn() + .mockImplementationOnce(async () => [MOCKED_USER]); + mockSplunkOnCallApi.getRoutingKeys = jest + .fn() + .mockImplementationOnce(async () => [MOCK_ROUTING_KEY]); + mockSplunkOnCallApi.getTeams = jest + .fn() + .mockImplementation(async () => [MOCK_TEAM]); + + const { getByText, queryByTestId } = render( + wrapInTestApp( + + + + + , + ), + ); + await waitFor(() => !queryByTestId('progress')); + expect(getByText(`Team: ${MOCK_TEAM.name}`)).toBeInTheDocument(); + await waitFor( + () => + expect(getByText(MOCK_INCIDENT.entityDisplayName)).toBeInTheDocument(), + { timeout: 2000 }, + ); + }); + it('Handles custom error for missing token', async () => { mockSplunkOnCallApi.getUsers = jest .fn() From ba1a3e9456363bd59d5e56042385fd26588be876 Mon Sep 17 00:00:00 2001 From: Mike Ball Date: Fri, 4 Feb 2022 07:51:18 -0500 Subject: [PATCH 10/24] add splunk.com/on-call-routing-key docs to README Signed-off-by: Mike Ball --- plugins/splunk-on-call/README.md | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/plugins/splunk-on-call/README.md b/plugins/splunk-on-call/README.md index 52803473b0..ddf31ee49f 100644 --- a/plugins/splunk-on-call/README.md +++ b/plugins/splunk-on-call/README.md @@ -2,11 +2,11 @@ ## Overview -This plugin displays Splunk On-Call, formerly VictorOps, information about an entity. +This plugin displays Splunk On-Call (formerly VictorOps) information associated with an entity. -There is a way to trigger an new incident directly to specific users or/and specific teams. +It also provides the ability to trigger new incidents directly to specific users or/and specific teams from within Backstage. -This plugin requires that entities are annotated with a team name. See more further down in this document. +This plugin requires that entities feature either a `splunk.com/on-call-team` or a `splunk.com/on-call-routing-key` annotation. See below for further details. This plugin provides: @@ -76,12 +76,22 @@ In addition, to make certain API calls (trigger-resolve-acknowledge an incident) ### Adding your team name to the entity annotation -The information displayed for each entity is based on the team name. -If you want to use this plugin for an entity, you need to label it with the below annotation: +The information displayed for each entity is based on either an associated team name or an associated routing key. + +To use this plugin for an entity, the entity must be labeled with either a `splunk.com/on-call-team` or a `splunk.com/on-call-routing-key` annotation. + +For example, by specifying a `splunk.com/on-call-team`, the plugin displays Splunk On-Call data associated with the specified team: ```yaml annotations: - splunk.com/on-call-team': + splunk.com/on-call-team: +``` + +Alternatively, by specifying a `splunk.com/on-call-routing-key`, the plugin displays Splunk On-Call data associated with _each_ of the teams associated with the specified routing key: + +```yaml +annotations: + splunk.com/on-call-routing-key: ``` ### Create the Routing Key From c17be55ffbddbd7354556c8f68d49453cf8eca3f Mon Sep 17 00:00:00 2001 From: Mike Ball Date: Fri, 4 Feb 2022 07:57:51 -0500 Subject: [PATCH 11/24] add Splunk On-Call plugin changeset Adds a changeset associated with the Splunk On-Call plugin's support for a new `splunk.com/on-call-routing-key` annotation. Signed-off-by: Mike Ball --- .changeset/honest-foxes-scream.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/honest-foxes-scream.md diff --git a/.changeset/honest-foxes-scream.md b/.changeset/honest-foxes-scream.md new file mode 100644 index 0000000000..c684c40d72 --- /dev/null +++ b/.changeset/honest-foxes-scream.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-splunk-on-call': minor +--- + +Add Splunk On-Call plugin support for a 'splunk.com/on-call-routing-key' annotation. If the 'splunk.com/on-call-routing-key' is provided, the plugin displays a Splunk On-Call card for each of the teams associated with the routing key. From 12182960f421a5ca37ca21fdd15999000f31952c Mon Sep 17 00:00:00 2001 From: Mike Ball Date: Fri, 4 Feb 2022 08:21:30 -0500 Subject: [PATCH 12/24] address TypeScript compilation failure This fixes... ``` Run yarn tsc yarn run v1.22.1 $ tsc plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx:158:26 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'Matcher'. Type 'undefined' is not assignable to type 'Matcher'. 158 expect(getByText(MOCK_INCIDENT.entityDisplayName)).toBeInTheDocument(), ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` Signed-off-by: Mike Ball --- .../src/components/EntitySplunkOnCallCard.test.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx index 9c16752421..da248ebec0 100644 --- a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx +++ b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx @@ -154,8 +154,7 @@ describe('SplunkOnCallCard', () => { await waitFor(() => !queryByTestId('progress')); expect(getByText(`Team: ${MOCK_TEAM.name}`)).toBeInTheDocument(); await waitFor( - () => - expect(getByText(MOCK_INCIDENT.entityDisplayName)).toBeInTheDocument(), + () => expect(getByText('test-incident')).toBeInTheDocument(), { timeout: 2000 }, ); }); From 4ddc657bd349e427720e07b3be61884433993a5c Mon Sep 17 00:00:00 2001 From: Mike Ball Date: Fri, 4 Feb 2022 08:32:08 -0500 Subject: [PATCH 13/24] add Splunk client `getRoutingKeys` method documentation Signed-off-by: Mike Ball --- plugins/splunk-on-call/api-report.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/splunk-on-call/api-report.md b/plugins/splunk-on-call/api-report.md index 19f60ffd13..8e8076d9e8 100644 --- a/plugins/splunk-on-call/api-report.md +++ b/plugins/splunk-on-call/api-report.md @@ -51,6 +51,10 @@ export class SplunkOnCallClient implements SplunkOnCallApi { // // (undocumented) getOnCallUsers(): Promise; + // Warning: (ae-forgotten-export) The symbol "RoutingKey" needs to be exported by the entry point index.d.ts + // + // (undocumented) + getRoutingKeys(): Promise; // Warning: (ae-forgotten-export) The symbol "Team" needs to be exported by the entry point index.d.ts // // (undocumented) From a957b9fc4d5ec80f8da55675881aa1e886bb6812 Mon Sep 17 00:00:00 2001 From: Mike Ball Date: Fri, 4 Feb 2022 08:38:38 -0500 Subject: [PATCH 14/24] fine-tune Splunk On-Call README language Signed-off-by: Mike Ball --- plugins/splunk-on-call/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/splunk-on-call/README.md b/plugins/splunk-on-call/README.md index ddf31ee49f..0200cacc50 100644 --- a/plugins/splunk-on-call/README.md +++ b/plugins/splunk-on-call/README.md @@ -4,14 +4,14 @@ This plugin displays Splunk On-Call (formerly VictorOps) information associated with an entity. -It also provides the ability to trigger new incidents directly to specific users or/and specific teams from within Backstage. +It also provides the ability to trigger new incidents to specific users and/or specific teams from within Backstage. This plugin requires that entities feature either a `splunk.com/on-call-team` or a `splunk.com/on-call-routing-key` annotation. See below for further details. This plugin provides: - A list of incidents -- A way to trigger a new incident to specific users or/and teams +- A way to trigger a new incident to specific users and/or teams - A way to acknowledge/resolve an incident - Information details about the persons on-call @@ -47,7 +47,7 @@ const overviewContent = ( ## Client configuration -In order to be able to perform certain action (create-acknowledge-resolve an action), you need to provide a REST Endpoint. +In order to be able to perform certain actions (create-acknowledge-resolve an action), you need to provide a REST Endpoint. To enable the REST Endpoint integration you can go on https://portal.victorops.com/ inside Integrations > 3rd Party Integrations > REST – Generic. You can now copy the URL to notify: `/$routing_key` From da9d1723f6f35b50b4af5f16fc92442b0724c593 Mon Sep 17 00:00:00 2001 From: Mike Ball Date: Fri, 4 Feb 2022 10:04:49 -0500 Subject: [PATCH 15/24] invalid annotation logic better reflects component logic The EntitySplunkOnCallCard gives precedence to a `splunk.com/on-call-team` annotation. Therefore, the InvalidAnnotation component messaging should reflect that precedence, even in instances where _both_ supported annotations are provided and both are deemed invalid. Signed-off-by: Mike Ball --- .../src/components/EntitySplunkOnCallCard.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx index db479f9459..109484ac04 100644 --- a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx +++ b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx @@ -68,14 +68,14 @@ export const InvalidAnnotation = ({ }) => { let titleSuffix = 'provided annotation'; - if (teamName) { - titleSuffix = `"${teamName}" team name`; - } - if (routingKey) { titleSuffix = `"${routingKey}" routing key`; } + if (teamName) { + titleSuffix = `"${teamName}" team name`; + } + return ( From 9fa811ddbb6eb440c4a518989fd55b054b120dab Mon Sep 17 00:00:00 2001 From: Mike Ball Date: Mon, 7 Feb 2022 10:06:23 -0500 Subject: [PATCH 16/24] Update .changeset/honest-foxes-scream.md Co-authored-by: Johan Haals Signed-off-by: Mike Ball --- .changeset/honest-foxes-scream.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/honest-foxes-scream.md b/.changeset/honest-foxes-scream.md index c684c40d72..4737e47cef 100644 --- a/.changeset/honest-foxes-scream.md +++ b/.changeset/honest-foxes-scream.md @@ -2,4 +2,4 @@ '@backstage/plugin-splunk-on-call': minor --- -Add Splunk On-Call plugin support for a 'splunk.com/on-call-routing-key' annotation. If the 'splunk.com/on-call-routing-key' is provided, the plugin displays a Splunk On-Call card for each of the teams associated with the routing key. +Add Splunk On-Call plugin support for a `splunk.com/on-call-routing-key` annotation. If the `splunk.com/on-call-routing-key` is provided, the plugin displays a Splunk On-Call card for each of the teams associated with the routing key. From 1514d8a3137148964ab78907fa0c0739fde8b8ba Mon Sep 17 00:00:00 2001 From: Mike Ball Date: Mon, 7 Feb 2022 10:06:30 -0500 Subject: [PATCH 17/24] Update plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx Co-authored-by: Johan Haals Signed-off-by: Mike Ball --- .../splunk-on-call/src/components/EntitySplunkOnCallCard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx index 109484ac04..70aeb98cbd 100644 --- a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx +++ b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx @@ -215,7 +215,7 @@ export const EntitySplunkOnCallCard = () => { team: Team | undefined; usersHashMap: any; }) => { - const teamName = team && team.name ? team.name : ''; + const teamName = team?.name ?? ''; return ( <> From 04365cd21355ed000389c764543811e675c3b211 Mon Sep 17 00:00:00 2001 From: Mike Ball Date: Mon, 7 Feb 2022 12:12:35 -0500 Subject: [PATCH 18/24] display only 1 `` Per code review feedback, it's arguably unnecessary to display duplicate ``, especially given the preceding contextual sentence noting the supported annotations. Signed-off-by: Mike Ball --- plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx index 70aeb98cbd..4a6f983636 100644 --- a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx +++ b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx @@ -55,7 +55,6 @@ export const MissingAnnotation = () => ( {SPLUNK_ON_CALL_ROUTING_KEY} annotation. - ); From 9552df7653c0f0b2ef08c961f4ca503a893f055a Mon Sep 17 00:00:00 2001 From: Mike Ball Date: Mon, 7 Feb 2022 13:55:01 -0500 Subject: [PATCH 19/24] test reflects occurrence of single 'Missing Annotation' Signed-off-by: Mike Ball --- .../src/components/EntitySplunkOnCallCard.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx index da248ebec0..a83db136e4 100644 --- a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx +++ b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx @@ -212,7 +212,7 @@ describe('SplunkOnCallCard', () => { ), ); await waitFor(() => !queryByTestId('progress')); - expect(getAllByText('Missing Annotation').length).toEqual(2); + expect(getAllByText('Missing Annotation').length).toEqual(1); }); it('handles warning for incorrect team annotation', async () => { From 5255292a2a0c5e7a84ea59f53c74439f21e4b4ac Mon Sep 17 00:00:00 2001 From: Mike Ball Date: Mon, 7 Feb 2022 17:04:01 -0500 Subject: [PATCH 20/24] update changeset to be 'patch' change Per code review feedback: https://github.com/backstage/backstage/pull/9362#discussion_r800480438 Signed-off-by: Mike Ball --- .changeset/honest-foxes-scream.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/honest-foxes-scream.md b/.changeset/honest-foxes-scream.md index 4737e47cef..f2d80b63a9 100644 --- a/.changeset/honest-foxes-scream.md +++ b/.changeset/honest-foxes-scream.md @@ -1,5 +1,5 @@ --- -'@backstage/plugin-splunk-on-call': minor +'@backstage/plugin-splunk-on-call': patch --- Add Splunk On-Call plugin support for a `splunk.com/on-call-routing-key` annotation. If the `splunk.com/on-call-routing-key` is provided, the plugin displays a Splunk On-Call card for each of the teams associated with the routing key. From 9ed980cc2819275e4a1b30437c1d1445c3eed3b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Feb 2022 04:26:49 +0000 Subject: [PATCH 21/24] chore(deps): bump @roadiehq/backstage-plugin-github-pull-requests Bumps [@roadiehq/backstage-plugin-github-pull-requests](https://github.com/RoadieHQ/roadie-backstage-plugins/tree/HEAD/plugins/frontend/backstage-plugin-github-pull-requests) from 1.3.4 to 1.3.7. - [Release notes](https://github.com/RoadieHQ/roadie-backstage-plugins/releases) - [Changelog](https://github.com/RoadieHQ/roadie-backstage-plugins/blob/main/plugins/frontend/backstage-plugin-github-pull-requests/CHANGELOG.md) - [Commits](https://github.com/RoadieHQ/roadie-backstage-plugins/commits/HEAD/plugins/frontend/backstage-plugin-github-pull-requests) --- updated-dependencies: - dependency-name: "@roadiehq/backstage-plugin-github-pull-requests" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 71 +++++-------------------------------------------------- 1 file changed, 6 insertions(+), 65 deletions(-) diff --git a/yarn.lock b/yarn.lock index f6e6d29d57..7ef55c3caf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4110,18 +4110,6 @@ "@octokit/request-error" "^2.1.0" "@octokit/types" "^6.0.3" -"@octokit/core@^3.2.3": - version "3.2.4" - resolved "https://registry.npmjs.org/@octokit/core/-/core-3.2.4.tgz#5791256057a962eca972e31818f02454897fd106" - integrity sha512-d9dTsqdePBqOn7aGkyRFe7pQpCXdibSJ5SFnrTr0axevObZrpz3qkWm7t/NjYv5a66z6vhfteriaq4FRz3e0Qg== - dependencies: - "@octokit/auth-token" "^2.4.4" - "@octokit/graphql" "^4.5.8" - "@octokit/request" "^5.4.12" - "@octokit/types" "^6.0.3" - before-after-hook "^2.1.0" - universal-user-agent "^6.0.0" - "@octokit/core@^3.3.2", "@octokit/core@^3.4.0", "@octokit/core@^3.5.1": version "3.5.1" resolved "https://registry.npmjs.org/@octokit/core/-/core-3.5.1.tgz#8601ceeb1ec0e1b1b8217b960a413ed8e947809b" @@ -4205,11 +4193,6 @@ resolved "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-11.2.0.tgz#b38d7fc3736d52a1e96b230c1ccd4a58a2f400a6" integrity sha512-PBsVO+15KSlGmiI8QAzaqvsNlZlrDlyAJYcrXBCvVUxCp7VnXjkwPoFHgjEJXx3WF9BAwkA6nfCUA7i9sODzKA== -"@octokit/openapi-types@^7.3.2": - version "7.3.2" - resolved "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-7.3.2.tgz#065ce49b338043ec7f741316ce06afd4d459d944" - integrity sha512-oJhK/yhl9Gt430OrZOzAl2wJqR0No9445vmZ9Ey8GjUZUpwuu/vmEFP0TDhDXdpGDoxD6/EIFHJEcY8nHXpDTA== - "@octokit/plugin-enterprise-rest@^6.0.1": version "6.0.1" resolved "https://registry.npmjs.org/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-6.0.1.tgz#e07896739618dab8da7d4077c658003775f95437" @@ -4222,31 +4205,11 @@ dependencies: "@octokit/types" "^6.34.0" -"@octokit/plugin-paginate-rest@^2.6.2": - version "2.7.0" - resolved "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.7.0.tgz#6bb7b043c246e0654119a6ec4e72a172c9e2c7f3" - integrity sha512-+zARyncLjt9b0FjqPAbJo4ss7HOlBi1nprq+cPlw5vu2+qjy7WvlXhtXFdRHQbSL1Pt+bfAKaLADEkkvg8sP8w== - dependencies: - "@octokit/types" "^6.0.1" - -"@octokit/plugin-request-log@^1.0.2": - version "1.0.2" - resolved "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.2.tgz#394d59ec734cd2f122431fbaf05099861ece3c44" - integrity sha512-oTJSNAmBqyDR41uSMunLQKMX0jmEXbwD1fpz8FG27lScV3RhtGfBa1/BBLym+PxcC16IBlF7KH9vP1BUYxA+Eg== - "@octokit/plugin-request-log@^1.0.4": version "1.0.4" resolved "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz#5e50ed7083a613816b1e4a28aeec5fb7f1462e85" integrity sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA== -"@octokit/plugin-rest-endpoint-methods@5.3.1": - version "5.3.1" - resolved "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.3.1.tgz#deddce769b4ec3179170709ab42e4e9e6195aaa9" - integrity sha512-3B2iguGmkh6bQQaVOtCsS0gixrz8Lg0v4JuXPqBcFqLKuJtxAUf3K88RxMEf/naDOI73spD+goJ/o7Ie7Cvdjg== - dependencies: - "@octokit/types" "^6.16.2" - deprecation "^2.3.1" - "@octokit/plugin-rest-endpoint-methods@^5.12.0": version "5.13.0" resolved "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.13.0.tgz#8c46109021a3412233f6f50d28786f8e552427ba" @@ -4292,17 +4255,7 @@ node-fetch "^2.6.1" universal-user-agent "^6.0.0" -"@octokit/rest@^18.1.0", "@octokit/rest@^18.5.3": - version "18.5.6" - resolved "https://registry.npmjs.org/@octokit/rest/-/rest-18.5.6.tgz#8c9a7c9329c7bbf478af20df78ddeab0d21f6d89" - integrity sha512-8HdG6ZjQdZytU6tCt8BQ2XLC7EJ5m4RrbyU/EARSkAM1/HP3ceOzMG/9atEfe17EDMer3IVdHWLedz2wDi73YQ== - dependencies: - "@octokit/core" "^3.2.3" - "@octokit/plugin-paginate-rest" "^2.6.2" - "@octokit/plugin-request-log" "^1.0.2" - "@octokit/plugin-rest-endpoint-methods" "5.3.1" - -"@octokit/rest@^18.12.0": +"@octokit/rest@^18.1.0", "@octokit/rest@^18.12.0", "@octokit/rest@^18.5.3": version "18.12.0" resolved "https://registry.npmjs.org/@octokit/rest/-/rest-18.12.0.tgz#f06bc4952fc87130308d810ca9d00e79f6988881" integrity sha512-gDPiOHlyGavxr72y0guQEhLsemgVjwRePayJ+FcKc2SJqKUbxbkvf5kAZEWA/MKvsfYlQAMVzNJE3ezQcxMJ2Q== @@ -4319,14 +4272,7 @@ dependencies: "@types/node" ">= 8" -"@octokit/types@^6.0.0", "@octokit/types@^6.0.1", "@octokit/types@^6.0.3", "@octokit/types@^6.10.0", "@octokit/types@^6.12.2", "@octokit/types@^6.14.2", "@octokit/types@^6.16.1", "@octokit/types@^6.16.2", "@octokit/types@^6.8.2": - version "6.16.4" - resolved "https://registry.npmjs.org/@octokit/types/-/types-6.16.4.tgz#d24f5e1bacd2fe96d61854b5bda0e88cf8288dfe" - integrity sha512-UxhWCdSzloULfUyamfOg4dJxV9B+XjgrIZscI0VCbp4eNrjmorGEw+4qdwcpTsu6DIrm9tQsFQS2pK5QkqQ04A== - dependencies: - "@octokit/openapi-types" "^7.3.2" - -"@octokit/types@^6.26.0", "@octokit/types@^6.27.1", "@octokit/types@^6.34.0": +"@octokit/types@^6.0.0", "@octokit/types@^6.0.1", "@octokit/types@^6.0.3", "@octokit/types@^6.10.0", "@octokit/types@^6.12.2", "@octokit/types@^6.14.2", "@octokit/types@^6.16.1", "@octokit/types@^6.26.0", "@octokit/types@^6.27.1", "@octokit/types@^6.34.0", "@octokit/types@^6.8.2": version "6.34.0" resolved "https://registry.npmjs.org/@octokit/types/-/types-6.34.0.tgz#c6021333334d1ecfb5d370a8798162ddf1ae8218" integrity sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw== @@ -4512,13 +4458,13 @@ react-use "^17.2.4" "@roadiehq/backstage-plugin-github-pull-requests@^1.3.2": - version "1.3.4" - resolved "https://registry.npmjs.org/@roadiehq/backstage-plugin-github-pull-requests/-/backstage-plugin-github-pull-requests-1.3.4.tgz#3e6be41fe81909b28a3d517aadcc7ae6b70d7d7a" - integrity sha512-F1y3CmMZOiNiam3zt6TBaJ5+NqAhPwS3HkWbUsMvJq1PKAzYdSeDBPhoTBwhYOu3uV36EtKjfog4r4wVHOf7EA== + version "1.3.7" + resolved "https://registry.npmjs.org/@roadiehq/backstage-plugin-github-pull-requests/-/backstage-plugin-github-pull-requests-1.3.7.tgz#d3c884c9b85f88c5f851f383596a616598c56076" + integrity sha512-a3PBLQ6SRtEDGNIekcGT8v4Aaac3BoEww/UU9uaQuE7bCEVolx2MeOVbSxb1uCWr6C6uGeDF5Kw4S4hPJJcnNg== dependencies: "@backstage/catalog-model" "^0.9.7" "@backstage/core-components" "^0.8.0" - "@backstage/core-plugin-api" "^0.4.0" + "@backstage/core-plugin-api" "^0.6.0" "@backstage/plugin-catalog-react" "^0.6.5" "@material-ui/core" "^4.11.0" "@material-ui/icons" "^4.9.1" @@ -7757,11 +7703,6 @@ bdd-lazy-var@^2.6.0: resolved "https://registry.npmjs.org/bdd-lazy-var/-/bdd-lazy-var-2.6.1.tgz#ca03fb36d68c5a507c0ba9a4d53160b899e6b7cb" integrity sha512-X3ADwcFji/IHIrYJhTTpaiWhoOx4pl4whdAx1dmvdeUPsMUb7fVYFvf/Q33VEAEAVkEwi5rgNSZ0Y9oOVeQV+A== -before-after-hook@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.1.0.tgz#b6c03487f44e24200dd30ca5e6a1979c5d2fb635" - integrity sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A== - before-after-hook@^2.2.0: version "2.2.2" resolved "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz#a6e8ca41028d90ee2c24222f201c90956091613e" From 4f743087e419983e9241ed3b1e327c0c439d88d7 Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 9 Feb 2022 11:15:51 +0100 Subject: [PATCH 22/24] chore: updating yarn.lock Signed-off-by: blam --- yarn.lock | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 2 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7ef55c3caf..232f883cf0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4110,6 +4110,18 @@ "@octokit/request-error" "^2.1.0" "@octokit/types" "^6.0.3" +"@octokit/core@^3.2.3": + version "3.2.4" + resolved "https://registry.npmjs.org/@octokit/core/-/core-3.2.4.tgz#5791256057a962eca972e31818f02454897fd106" + integrity sha512-d9dTsqdePBqOn7aGkyRFe7pQpCXdibSJ5SFnrTr0axevObZrpz3qkWm7t/NjYv5a66z6vhfteriaq4FRz3e0Qg== + dependencies: + "@octokit/auth-token" "^2.4.4" + "@octokit/graphql" "^4.5.8" + "@octokit/request" "^5.4.12" + "@octokit/types" "^6.0.3" + before-after-hook "^2.1.0" + universal-user-agent "^6.0.0" + "@octokit/core@^3.3.2", "@octokit/core@^3.4.0", "@octokit/core@^3.5.1": version "3.5.1" resolved "https://registry.npmjs.org/@octokit/core/-/core-3.5.1.tgz#8601ceeb1ec0e1b1b8217b960a413ed8e947809b" @@ -4193,6 +4205,11 @@ resolved "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-11.2.0.tgz#b38d7fc3736d52a1e96b230c1ccd4a58a2f400a6" integrity sha512-PBsVO+15KSlGmiI8QAzaqvsNlZlrDlyAJYcrXBCvVUxCp7VnXjkwPoFHgjEJXx3WF9BAwkA6nfCUA7i9sODzKA== +"@octokit/openapi-types@^7.3.2": + version "7.3.2" + resolved "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-7.3.2.tgz#065ce49b338043ec7f741316ce06afd4d459d944" + integrity sha512-oJhK/yhl9Gt430OrZOzAl2wJqR0No9445vmZ9Ey8GjUZUpwuu/vmEFP0TDhDXdpGDoxD6/EIFHJEcY8nHXpDTA== + "@octokit/plugin-enterprise-rest@^6.0.1": version "6.0.1" resolved "https://registry.npmjs.org/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-6.0.1.tgz#e07896739618dab8da7d4077c658003775f95437" @@ -4205,11 +4222,31 @@ dependencies: "@octokit/types" "^6.34.0" +"@octokit/plugin-paginate-rest@^2.6.2": + version "2.7.0" + resolved "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.7.0.tgz#6bb7b043c246e0654119a6ec4e72a172c9e2c7f3" + integrity sha512-+zARyncLjt9b0FjqPAbJo4ss7HOlBi1nprq+cPlw5vu2+qjy7WvlXhtXFdRHQbSL1Pt+bfAKaLADEkkvg8sP8w== + dependencies: + "@octokit/types" "^6.0.1" + +"@octokit/plugin-request-log@^1.0.2": + version "1.0.2" + resolved "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.2.tgz#394d59ec734cd2f122431fbaf05099861ece3c44" + integrity sha512-oTJSNAmBqyDR41uSMunLQKMX0jmEXbwD1fpz8FG27lScV3RhtGfBa1/BBLym+PxcC16IBlF7KH9vP1BUYxA+Eg== + "@octokit/plugin-request-log@^1.0.4": version "1.0.4" resolved "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz#5e50ed7083a613816b1e4a28aeec5fb7f1462e85" integrity sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA== +"@octokit/plugin-rest-endpoint-methods@5.3.1": + version "5.3.1" + resolved "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.3.1.tgz#deddce769b4ec3179170709ab42e4e9e6195aaa9" + integrity sha512-3B2iguGmkh6bQQaVOtCsS0gixrz8Lg0v4JuXPqBcFqLKuJtxAUf3K88RxMEf/naDOI73spD+goJ/o7Ie7Cvdjg== + dependencies: + "@octokit/types" "^6.16.2" + deprecation "^2.3.1" + "@octokit/plugin-rest-endpoint-methods@^5.12.0": version "5.13.0" resolved "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.13.0.tgz#8c46109021a3412233f6f50d28786f8e552427ba" @@ -4255,7 +4292,17 @@ node-fetch "^2.6.1" universal-user-agent "^6.0.0" -"@octokit/rest@^18.1.0", "@octokit/rest@^18.12.0", "@octokit/rest@^18.5.3": +"@octokit/rest@^18.1.0", "@octokit/rest@^18.5.3": + version "18.5.6" + resolved "https://registry.npmjs.org/@octokit/rest/-/rest-18.5.6.tgz#8c9a7c9329c7bbf478af20df78ddeab0d21f6d89" + integrity sha512-8HdG6ZjQdZytU6tCt8BQ2XLC7EJ5m4RrbyU/EARSkAM1/HP3ceOzMG/9atEfe17EDMer3IVdHWLedz2wDi73YQ== + dependencies: + "@octokit/core" "^3.2.3" + "@octokit/plugin-paginate-rest" "^2.6.2" + "@octokit/plugin-request-log" "^1.0.2" + "@octokit/plugin-rest-endpoint-methods" "5.3.1" + +"@octokit/rest@^18.12.0": version "18.12.0" resolved "https://registry.npmjs.org/@octokit/rest/-/rest-18.12.0.tgz#f06bc4952fc87130308d810ca9d00e79f6988881" integrity sha512-gDPiOHlyGavxr72y0guQEhLsemgVjwRePayJ+FcKc2SJqKUbxbkvf5kAZEWA/MKvsfYlQAMVzNJE3ezQcxMJ2Q== @@ -4272,7 +4319,14 @@ dependencies: "@types/node" ">= 8" -"@octokit/types@^6.0.0", "@octokit/types@^6.0.1", "@octokit/types@^6.0.3", "@octokit/types@^6.10.0", "@octokit/types@^6.12.2", "@octokit/types@^6.14.2", "@octokit/types@^6.16.1", "@octokit/types@^6.26.0", "@octokit/types@^6.27.1", "@octokit/types@^6.34.0", "@octokit/types@^6.8.2": +"@octokit/types@^6.0.0", "@octokit/types@^6.0.1", "@octokit/types@^6.0.3", "@octokit/types@^6.10.0", "@octokit/types@^6.12.2", "@octokit/types@^6.14.2", "@octokit/types@^6.16.1", "@octokit/types@^6.16.2", "@octokit/types@^6.8.2": + version "6.16.4" + resolved "https://registry.npmjs.org/@octokit/types/-/types-6.16.4.tgz#d24f5e1bacd2fe96d61854b5bda0e88cf8288dfe" + integrity sha512-UxhWCdSzloULfUyamfOg4dJxV9B+XjgrIZscI0VCbp4eNrjmorGEw+4qdwcpTsu6DIrm9tQsFQS2pK5QkqQ04A== + dependencies: + "@octokit/openapi-types" "^7.3.2" + +"@octokit/types@^6.26.0", "@octokit/types@^6.27.1", "@octokit/types@^6.34.0": version "6.34.0" resolved "https://registry.npmjs.org/@octokit/types/-/types-6.34.0.tgz#c6021333334d1ecfb5d370a8798162ddf1ae8218" integrity sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw== @@ -7703,6 +7757,11 @@ bdd-lazy-var@^2.6.0: resolved "https://registry.npmjs.org/bdd-lazy-var/-/bdd-lazy-var-2.6.1.tgz#ca03fb36d68c5a507c0ba9a4d53160b899e6b7cb" integrity sha512-X3ADwcFji/IHIrYJhTTpaiWhoOx4pl4whdAx1dmvdeUPsMUb7fVYFvf/Q33VEAEAVkEwi5rgNSZ0Y9oOVeQV+A== +before-after-hook@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.1.0.tgz#b6c03487f44e24200dd30ca5e6a1979c5d2fb635" + integrity sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A== + before-after-hook@^2.2.0: version "2.2.2" resolved "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz#a6e8ca41028d90ee2c24222f201c90956091613e" From 4457994dae9e0fbbdae9c5b6259220eea3b871ca Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 9 Feb 2022 12:46:41 +0100 Subject: [PATCH 23/24] workflows: fix package paths in manifest sync Signed-off-by: Patrik Oldsberg --- .github/workflows/sync_release-manifest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync_release-manifest.yml b/.github/workflows/sync_release-manifest.yml index b02af02f9d..4b44caafba 100644 --- a/.github/workflows/sync_release-manifest.yml +++ b/.github/workflows/sync_release-manifest.yml @@ -62,7 +62,7 @@ jobs: workflow_id: 'release.yml', ref: 'master', inputs: { - version: require('./package.json').version, + version: require('./backstage/package.json').version, }, }); @@ -73,6 +73,6 @@ jobs: workflow_id: 'release.yml', ref: 'master', inputs: { - version: require('./packages/create-app/package.json').version, + version: require('./backstage/packages/create-app/package.json').version, }, }); From 083666d4e629733d06a9f9b55ad9294b1391e234 Mon Sep 17 00:00:00 2001 From: Lorenzo Orsatti <49567430+lorsatti@users.noreply.github.com> Date: Wed, 9 Feb 2022 12:48:42 +0100 Subject: [PATCH 24/24] LogMeIn is now GoTo Signed-off-by: Lorenzo Orsatti <49567430+lorsatti@users.noreply.github.com> --- ADOPTERS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ADOPTERS.md b/ADOPTERS.md index 7036b10b5e..beb161d9ee 100644 --- a/ADOPTERS.md +++ b/ADOPTERS.md @@ -71,7 +71,7 @@ | [Epic Games](https://www.epicgames.com) | [Brian Jung](https://github.com/brian-at-epic), [Jeff Goldian](https://github.com/jeffgoldian-Epic) | Developer Portal: Service Catalog, Documentation, Software Templates and more making our internal teams' lives easier! | | [Globo](https://globo.com) | [Carlos Gusmão](https://github.com/caeugusmao), [Guilherme Vierno](https://github.com/vierno), [Denis Aoki](https://github.com/dnsaoki2), [Maycon Dionisio](https://github.com/MayconDionisio), | Reduce the friction of accessing the information engineers need about Globo's digital services through a coherent and centralized experience. | | [QBE](https://www.qbe.com/) | [Daniel Steel](https://github.com/danielsteelqbe), [Pete Jespers](https://github.com/petejespersqbe) | Developer portal allowing our global teams to explore and create applications, documentation and cloud infrastructure easily and quickly 🚀 | -| [LogMeIn](https://www.logmein.com) | [Lorenzo Orsatti](https://github.com/lorsatti) | Improve onboarding experience of new developers. Discover faster and painlessly developer documentation, API definitions and team information. Provide useful dev metrics in a central place. Provide easy-to-use templates for new services. | +| [GoTo](https://www.goto.com) | [Lorenzo Orsatti](https://github.com/lorsatti) | Improve onboarding experience of new developers. Discover faster and painlessly developer documentation, API definitions and team information. Provide useful dev metrics in a central place. Provide easy-to-use templates for new services. | | [Telstra](https://www.telstra.com.au) | [@kiranpatel11](https://github.com/kiranpatel11), [JasonC](https://github.com/JasonC17) | Primary usage: software catalog and templates
Emerging usage : TechDocs, Explore Ecosystem, TechRadar, etc | | [Mosaico](https://www.mosaico.com.br/) | [Wédney Yuri](https://github.com/wedneyyuri),[@tino.milton](https://github.com/miltonjacomini) | A centralized service catalog of our documentation for our service engineers. | | [Mox Bank](https://www.mox.com/) | [Nick Laqua](https://github.com/nick-laqua-dragon), [Gauthier Roebroeck](https://github.com/gauthier-roebroeck-mox) | "Single pane of glass" developer portal for providing a best-in-class developer experience to our product teams and making Mox the best tech environment in Hongkong 🥰🚀 |