Skip to content

Commit

Permalink
Merge pull request #11 from mraible/github-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mraible authored Sep 26, 2024
2 parents 1d4cbc3 + b200bb2 commit eeb01c1
Show file tree
Hide file tree
Showing 12 changed files with 6,516 additions and 4,215 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Sample CI
on: [ push, pull_request ]

jobs:
build:
strategy:
matrix:
path:
- shared/mitre-vue
- ui/extensions/remediations
- ui/pages/chart-vue
name: Build and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- name: Run yarn install in ${{ matrix.path }}
uses: borales/actions-yarn@v5
with:
cmd: install
dir: ${{ matrix.path }}
- name: Build Vue app in ${{ matrix.path }}
if: matrix.path != 'shared/mitre-vue'
uses: borales/actions-yarn@v5
with:
cmd: build
dir: ${{ matrix.path }}
- name: Test the Vue app in ${{ matrix.path }}
uses: borales/actions-yarn@v5
with:
cmd: test:unit
dir: ${{ matrix.path }}
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.idea
node_modules
.idea
.idea/
node_modules/
.DS_Store
.vscode
yarn-error.log
yarn-error.log
.yarnrc.yml
.yarn/
4 changes: 2 additions & 2 deletions shared/mitre-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
},
"dependencies": {
"@crowdstrike/foundry-js": "0.10.0",
"@intlify/unplugin-vue-i18n": "^1.2.0",
"@shoelace-style/shoelace": "^2.8.0",
"pinia": "^2.1.3",
"vue": "^3.3.4",
"vue-i18n": "^9.3.0-beta.14-77e850b",
"@intlify/unplugin-vue-i18n": "^1.2.0"
"vue-i18n": "^9.3.0-beta.14-77e850b"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.2.0",
Expand Down
9 changes: 4 additions & 5 deletions shared/mitre-vue/tests/utils/transformData.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ describe('Unit test - transformData.ts', () => {
false,
false
)



result.map((tactic) => {
const listOfTechniques = tactic.techniques.map(t => t.technique_id);

Expand Down Expand Up @@ -124,7 +123,7 @@ describe('Unit test - transformData.ts', () => {
const from = new Date();
from.setDate(to.getDate() - 91)
const calculatedTrend = calculateTrend(exampleTrendData as TrendAggregate, from, to)
expect(calculatedTrend).toBe(1)
expect(calculatedTrend).toBe(-1)
})

it('Should calculate trend a 100% decrease', () => {
Expand Down Expand Up @@ -215,9 +214,9 @@ describe('Unit test - transformData.ts', () => {

expect(foundSubTechnique?.is_subtechnique).toBeTruthy()


const severityDetails = Object.values(foundSubTechnique?.severity_details)

technique?.sub_aggregates?.find(t => t.name === 'Severity')?.buckets.map((severity) =>{
expect(severityDetails.includes(severity.count)).toBeTruthy()
})
Expand Down
6 changes: 3 additions & 3 deletions ui/extensions/remediations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
"dependencies": {
"@crowdstrike/foundry-js": "0.10.0",
"@intlify/unplugin-vue-i18n": "^0.12.3",
"@mitre/vue-shared": "*",
"@shoelace-style/shoelace": "^2.8.0",
"pinia": "^2.1.3",
"vue": "^3.3.4",
"vue-i18n": "^9.3.0-beta.14-77e850b",
"@mitre/vue-shared": "*"
"vue-i18n": "^9.3.0-beta.14-77e850b"
},
"devDependencies": {
"@modyfi/vite-plugin-yaml": "^1.0.4",
Expand Down Expand Up @@ -54,5 +54,5 @@
},
"engines": {
"node": ">=18.12.0"
}
}
}
6 changes: 1 addition & 5 deletions ui/extensions/remediations/src/stores/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
*/
import type FalconApi from '@crowdstrike/foundry-js'
import type { I18NComposer } from '@mitre/vue-shared/plugins/i18n'
import type {
DetectionItem,
JiraPriorityItem,
NotifyConfig
} from '@mitre/vue-shared/types'
import type { DetectionItem, JiraPriorityItem, NotifyConfig } from '@mitre/vue-shared/types'
import {
getCreatedIssue,
getNotifyIRConfig,
Expand Down
4 changes: 2 additions & 2 deletions ui/pages/chart-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
"dependencies": {
"@crowdstrike/foundry-js": "0.10.0",
"@intlify/unplugin-vue-i18n": "^0.12.3",
"@mitre/vue-shared": "*",
"@shoelace-style/shoelace": "^2.8.0",
"pinia": "^2.1.3",
"vue": "^3.3.4",
"vue-i18n": "^9.3.0-beta.14-77e850b",
"vue-router": "^4.2.2",
"@mitre/vue-shared": "*"
"vue-router": "^4.2.2"
},
"devDependencies": {
"@modyfi/vite-plugin-yaml": "^1.0.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
*/
import { useConfigureJiraStore } from '@/stores/configure-jira'
import type FalconApi from '@crowdstrike/foundry-js'
import {
DotsMenuClosed24Component,
DotsMenuOpen24Component
} from '@mitre/vue-shared/icons'
import { DotsMenuClosed24Component, DotsMenuOpen24Component } from '@mitre/vue-shared/icons'
import type { I18NComposer } from '@mitre/vue-shared/plugins/i18n'
import SYMBOLS from '@mitre/vue-shared/utils/symbols'
import { inject, ref } from 'vue'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
/**
* Formatted detections number (compact format after 9999)
*/
import {
MitreDetectionFilledIcon,
MitreDetectionOutlinedIcon
} from '@mitre/vue-shared/icons'
import { MitreDetectionFilledIcon, MitreDetectionOutlinedIcon } from '@mitre/vue-shared/icons'
import type { I18NComposer } from '@mitre/vue-shared/plugins/i18n'
import SYMBOLS from '@mitre/vue-shared/utils/symbols'
import { computed, inject } from 'vue'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
/**
* Technique Detections Component
*/
import {
ActivityIcon,
ExternalLink16Icon,
MitreDetectionFilledIcon
} from '@mitre/vue-shared/icons'
import { ActivityIcon, ExternalLink16Icon, MitreDetectionFilledIcon } from '@mitre/vue-shared/icons'
import type { I18NComposer } from '@mitre/vue-shared/plugins/i18n'
import SYMBOLS from '@mitre/vue-shared/utils/symbols'
import { type SeverityDetail } from '@mitre/vue-shared/types'
Expand Down
5 changes: 1 addition & 4 deletions ui/pages/chart-vue/src/stores/matrix-chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,7 @@ export const useMatrixChartStore = defineStore('matrix-chart', () => {
showSubtechniques.value
)

const sortedTactics = reorderItems(
rawTactics,
showSubtechniques.value
)
const sortedTactics = reorderItems(rawTactics, showSubtechniques.value)

tactics.value = sortedTactics
setTechniqueMapping(tactics.value)
Expand Down
Loading

0 comments on commit eeb01c1

Please sign in to comment.