├── lib ├── typings │ └── .gitignore ├── aspect │ ├── community │ │ ├── ContentClassifier.ts │ │ ├── oss.ts │ │ ├── codeOfConduct.ts │ │ └── license.ts │ ├── git │ │ ├── dateUtils.ts │ │ ├── gitIgnore.ts │ │ └── branchCount.ts │ ├── compose │ │ ├── commonTypes.ts │ │ ├── microgrammarMatchAspect.ts │ │ ├── conditionalize.ts │ │ ├── matchAspect.ts │ │ └── fileMatchAspect.ts │ ├── reporters.ts │ ├── delivery │ │ ├── DeliveryAspect.ts │ │ ├── support │ │ │ └── goalListener.ts │ │ ├── storeFingerprintsPublisher.ts │ │ └── BuildAspect.ts │ ├── common │ │ ├── globVirtualizer.ts │ │ ├── inspectionVirtualizer.ts │ │ ├── codeOwnership.ts │ │ ├── virtualProjectAspect.ts │ │ └── inspectionAspect.ts │ ├── secret │ │ ├── snifferOptionsLoader.ts │ │ ├── exposedSecrets.ts │ │ └── secretSniffing.ts │ └── AspectReportDetailsRegistry.ts ├── graphql │ ├── mutation │ │ └── ingestScmCommit.graphql │ └── query │ │ ├── gitHubAppInstallationByOwner.graphql │ │ ├── scmProviderbyId.graphql │ │ └── aspectRegistrations.graphql ├── util │ ├── omit.ts │ ├── fileUtils.ts │ ├── fingerprintUtils.ts │ ├── showTiming.ts │ ├── commonBands.ts │ └── bands.ts ├── analysis │ ├── offline │ │ ├── SpideredRepo.ts │ │ ├── spider │ │ │ ├── ScmSearchCriteria.ts │ │ │ ├── github │ │ │ │ └── GitCommandGitProjectCloner.ts │ │ │ ├── analytics.ts │ │ │ ├── Spider.ts │ │ │ └── local │ │ │ │ └── LocalSpider.ts │ │ └── persist │ │ │ ├── pgClientFactory.ts │ │ │ └── pgUtils.ts │ ├── ProjectAnalysisResult.ts │ └── tracking │ │ └── analysisTrackingRoutes.ts ├── routes │ ├── web-app │ │ ├── webAppConfig.ts │ │ ├── computeAnalytics.ts │ │ ├── repositoryListPage.ts │ │ └── overviewPage.ts │ ├── support │ │ ├── tagUtils.ts │ │ └── treeMunging.ts │ ├── projectQueries.ts │ └── auth.ts ├── scorer │ ├── support │ │ └── exposeFingerprintScore.ts │ ├── scorerUtils.ts │ ├── commonWorkspaceScorers.ts │ └── scoring.ts ├── machine │ ├── machine.ts │ └── configureAspects.ts ├── tree │ └── sunburst.ts └── job │ └── registerAspect.ts ├── public ├── git.png ├── reset.png ├── exclude.png ├── require.png ├── taggydoober.png ├── taggydoober-error.png ├── taggydoober-warning.png ├── atomist-logo-small-white.png └── hexagonal-fruit-of-power.png ├── integration-test ├── docker-entrypoint.sh ├── Dockerfile └── README.md ├── .gitattributes ├── images └── dockerImageSunburst.png ├── ddl ├── cleanup.sql ├── migrations │ └── add_fingerprint_path.ddl └── create.ddl ├── webpack.config.js ├── .gitignore ├── .npmignore ├── views ├── utils.tsx ├── topLevelPage.tsx ├── aspectTrackingPage.tsx └── repoList.tsx ├── tsconfig.json ├── test ├── aspect │ ├── common │ │ ├── virtualProjectAspect.test.ts │ │ └── globAspect.test.ts │ ├── codeOfConduct.test.ts │ ├── license.test.ts │ ├── dockerParser.test.ts │ ├── secretSniffing.test.ts │ └── fileMatchAspect.test.ts ├── routes │ ├── api.test.ts │ └── wep-app │ │ └── webAppRoutes.test.ts ├── spider │ └── analytics.test.ts ├── analysis │ └── offline │ │ └── spider │ │ └── SpiderAnalyzer.test.ts ├── util │ └── bands.test.ts └── tree │ └── pruneLeaves.test.ts ├── SECURITY.md ├── secrets.yml ├── index.ts ├── CODE_OF_CONDUCT.md ├── CHANGELOG.md └── CONTRIBUTING.md /lib/typings/.gitignore: -------------------------------------------------------------------------------- 1 | types.ts 2 | -------------------------------------------------------------------------------- /public/git.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomist/sdm-pack-aspect/HEAD/public/git.png -------------------------------------------------------------------------------- /public/reset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomist/sdm-pack-aspect/HEAD/public/reset.png -------------------------------------------------------------------------------- /public/exclude.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomist/sdm-pack-aspect/HEAD/public/exclude.png -------------------------------------------------------------------------------- /public/require.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomist/sdm-pack-aspect/HEAD/public/require.png -------------------------------------------------------------------------------- /public/taggydoober.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomist/sdm-pack-aspect/HEAD/public/taggydoober.png -------------------------------------------------------------------------------- /integration-test/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | service postgresql start 4 | cd /app 5 | 6 | exec $* -------------------------------------------------------------------------------- /public/taggydoober-error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomist/sdm-pack-aspect/HEAD/public/taggydoober-error.png -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | legal/THIRD_PARTY.md linguist-generated=true 2 | 3 | # Happy WSL development 4 | * text=auto eol=lf 5 | -------------------------------------------------------------------------------- /images/dockerImageSunburst.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomist/sdm-pack-aspect/HEAD/images/dockerImageSunburst.png -------------------------------------------------------------------------------- /lib/aspect/community/ContentClassifier.ts: -------------------------------------------------------------------------------- 1 | 2 | export type ContentClassifier = (content: string) => string | undefined; 3 | -------------------------------------------------------------------------------- /public/taggydoober-warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomist/sdm-pack-aspect/HEAD/public/taggydoober-warning.png -------------------------------------------------------------------------------- /public/atomist-logo-small-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomist/sdm-pack-aspect/HEAD/public/atomist-logo-small-white.png -------------------------------------------------------------------------------- /public/hexagonal-fruit-of-power.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomist/sdm-pack-aspect/HEAD/public/hexagonal-fruit-of-power.png -------------------------------------------------------------------------------- /ddl/cleanup.sql: -------------------------------------------------------------------------------- 1 | -- Clean up the database 2 | delete from 3 | repo_fingerprints; 4 | delete from 5 | repo_snapshots; 6 | delete from 7 | fingerprints; 8 | delete from 9 | fingerprint_analytics; -------------------------------------------------------------------------------- /lib/graphql/mutation/ingestScmCommit.graphql: -------------------------------------------------------------------------------- 1 | mutation IngestScmCommit($providerId: String!, $commit: SCMCommitInput!) { 2 | ingestSCMCommit(scmProviderId: $providerId, scmCommitInput: $commit) { 3 | id 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /lib/graphql/query/gitHubAppInstallationByOwner.graphql: -------------------------------------------------------------------------------- 1 | query GitHubAppInstallationByOwner($name: String!) { 2 | GitHubAppInstallation(owner: $name) { 3 | token { 4 | secret 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | mode: "development", 3 | entry: { 4 | sunburstScript: "./lib/page/sunburstScript.js" 5 | }, 6 | output: { 7 | filename: "[name]-bundle.js", 8 | library: "SunburstYo" 9 | } 10 | } -------------------------------------------------------------------------------- /lib/graphql/query/scmProviderbyId.graphql: -------------------------------------------------------------------------------- 1 | query ScmProviderById($providerId: String!) { 2 | SCMProvider(providerId: $providerId) { 3 | url 4 | apiUrl 5 | providerType 6 | id 7 | providerId 8 | credential { 9 | scopes 10 | secret 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | *.iml 3 | .vscode/ 4 | *~ 5 | .#* 6 | .npmrc 7 | node_modules/ 8 | *.d.ts 9 | *.d.ts.map 10 | *.js 11 | *.js.map 12 | *.log 13 | *.txt 14 | /.nyc_output/ 15 | /build/ 16 | /coverage/ 17 | /doc/ 18 | /log/ 19 | git-info.json 20 | spidered 21 | !d3.*.min.js 22 | !jquery-3.4.1.min.js 23 | !webpack.config.js 24 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | *.iml 3 | .vscode/ 4 | *~ 5 | .#* 6 | .dockerignore 7 | .git* 8 | .npmrc* 9 | .travis.yml 10 | .atomist/ 11 | .nyc_output/ 12 | /build/ 13 | /doc/ 14 | /config/ 15 | /coverage/ 16 | /log/ 17 | /scripts/ 18 | /src/test/ 19 | /test/ 20 | /CO*.md 21 | /Dockerfile 22 | /assets/kubectl/ 23 | *.log 24 | *.txt 25 | -------------------------------------------------------------------------------- /ddl/migrations/add_fingerprint_path.ddl: -------------------------------------------------------------------------------- 1 | 2 | alter table repo_snapshots drop column path; 3 | 4 | alter table repo_fingerprints add column path varchar; 5 | 6 | update repo_fingerprints set path = ''; 7 | 8 | alter table repo_fingerprints drop constraint repo_fingerprints_pkey; 9 | 10 | alter table repo_fingerprints ADD PRIMARY KEY (repo_snapshot_id, fingerprint_id, path); -------------------------------------------------------------------------------- /lib/graphql/query/aspectRegistrations.graphql: -------------------------------------------------------------------------------- 1 | query AspectRegistrations($state: [AspectRegistrationState], $name: [String]) { 2 | AspectRegistration(state: $state, name: $name, _first: 100) { 3 | name 4 | owner 5 | displayName 6 | description 7 | shortName 8 | unit 9 | url 10 | manageable 11 | category 12 | endpoint 13 | uuid 14 | state 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /views/utils.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | 3 | export function collapsible(key: string, title: string, content: React.ReactElement, startOpen: boolean): React.ReactElement { 4 | return
| Name | Runs | FPs | Fails | Fastest run | 58 |
59 | {minniestMin} ms --- Range of time taken ---
60 | {maxiestMax} ms |
61 | Slowest run | 62 |
|---|
87 | Error:
${e.message}`;
88 | }
89 | return `Failed to load page. Please check the log output of ${conf.instanceMetadata.name}`;
90 | }
91 |
92 | function formatFingerprintUsageForDisplay(aspect: Aspect, fp: FingerprintUsage): FingerprintForDisplay {
93 | return {
94 | ...fp,
95 | displayName: defaultedToDisplayableFingerprintName(aspect)(fp.name),
96 | entropy: supportsEntropy(aspect) ? fp.entropy : undefined,
97 | };
98 | }
99 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to Atomist open source projects
2 |
3 | Have something you would like to contribute to this project? Awesome,
4 | and thanks for taking time to contribute! Here's what you need to
5 | know.
6 |
7 | ## Contributing code
8 |
9 | Is there an improvement to existing functionality or an entirely new
10 | feature you would like to see? Before creating enhancement
11 | suggestions, please check the issue list as you might find out that
12 | you don't need to create one.
13 |
14 | Did you know we have a [Slack community][slack]? This might be a
15 | great place to talk through your idea before starting. It allows you
16 | to see if anyone else is already working on something similar, having
17 | the same issue or to get feedback on your enhancement idea.
18 | Discussing things with the community first is likely to make the
19 | contribution process a better experience for yourself and those that
20 | are maintaining the projects.
21 |
22 | [slack]: https://join.atomist.com/
23 |
24 | If you do not find an open issue related to your contribution and
25 | discussions in the Slack community are positive, the next thing to do
26 | is to create an issue in the appropriate GitHub repository.
27 |
28 | * Before we can accept any code changes into the Atomist codebase,
29 | we need to get some of the legal stuff covered. This is pretty
30 | standard for open-source projects. We are using
31 | [cla-assisant.io][cla-assistant] to track our Contributor License
32 | Agreement (CLA) signatures. If you have not signed a CLA for the
33 | repository to which you are contributing, you will be prompted to
34 | when you create a pull request (PR).
35 | * Be sure there is an open issue related to the contribution.
36 | * Code contributions should successfully build and pass tests.
37 | * Commit messages should follow the [standard format][commit] and
38 | should include a [reference][ref] to the open issue they are
39 | addressing.
40 | * All code contributions should be submitted via
41 | a [pull request (PR) from a forked GitHub repository][pr].
42 | * Your PR will be reviewed by an Atomist developer.
43 |
44 | [cla-assistant]: https://cla-assistant.io/
45 | [commit]: http://chris.beams.io/posts/git-commit/
46 | [ref]: https://github.com/blog/957-introducing-issue-mentions
47 | [pr]: https://guides.github.com/activities/contributing-to-open-source/
48 |
49 | ## Reporting problems
50 |
51 | Please go through the checklist below before reporting a
52 | problem. There's a chance it may have already been reported, or
53 | resolved.
54 |
55 | * Check if you can reproduce the problem in the latest version of
56 | the project.
57 | * Search the [atomist-community Slack][slack] community for common
58 | questions and problems.
59 | * Understand which repo the bug should be reported in.
60 | * Scan the list of issues to see if the problem has previously been
61 | reported. If so, you may add a comment to the existing issue
62 | rather than creating a new one.
63 |
64 | You went through the list above and it is still something you would
65 | like to report? Then, please provide us with as much of the context,
66 | by explaininig the problem and including any additional details that
67 | would help maintainers reproduce the problem. The more details you
68 | provide in the bug report, the better.
69 |
70 | Bugs are tracked as GitHub issues. After you've determined which
71 | repository your bug is related to, create an issue on that repository
72 | and provide as much information as possible. Feel free to use
73 | the bug report template below if you like.
74 |
75 | At a minimum include the following:
76 |
77 | * Where did you find the bug? For example, did you encounter the bug
78 | in chat, the CLI, somewhere else?
79 | * What version are you using?
80 | * What command were you using when it happened? (including
81 | parameters where applicable)
82 |
83 | ```
84 | [Description of the problem]
85 |
86 | **How to Reproduce:**
87 |
88 | 1. [First Step]
89 | 2. [Second Step]
90 | 3. [n Step]
91 |
92 | **Expected behavior:**
93 |
94 | [Describe expected behavior here]
95 |
96 | **Observed behavior:**
97 |
98 | [Describe observed behavior here]
99 |
100 | **Screenshots and GIFs**
101 |
102 | 
103 |
104 | **Project version:** [Enter project version]
105 | **Atomist CLI version:** [Enter CLI version]
106 | ```
107 |
108 | This project adheres to the Contributor Covenant [code of
109 | conduct][conduct]. By participating, you are expected to uphold this
110 | code. Please report unacceptable behavior to
111 | [code-of-conduct@atomist.com][email].
112 |
113 | [conduct]: CODE_OF_CONDUCT.md
114 | [email]: mailto:code-of-conduct@atomist.com
115 |
--------------------------------------------------------------------------------
/lib/analysis/offline/spider/local/LocalSpider.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2019 Atomist, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | import {
18 | GitCommandGitProject,
19 | GitProject,
20 | logger,
21 | RepoId,
22 | RepoRef,
23 | } from "@atomist/automation-client";
24 | import { execPromise } from "@atomist/sdm";
25 | import * as fs from "fs-extra";
26 | import * as path from "path";
27 | import { AnalysisTracker } from "../../../tracking/analysisTracker";
28 | import {
29 | AnalysisRun,
30 | } from "../common";
31 | import { ScmSearchCriteria } from "../ScmSearchCriteria";
32 | import {
33 | Analyzer,
34 | Spider,
35 | SpiderOptions,
36 | SpiderResult,
37 | } from "../Spider";
38 |
39 | export class LocalSpider implements Spider {
40 |
41 | public async spider(criteria: ScmSearchCriteria,
42 | analyzer: Analyzer,
43 | analysisTracking: AnalysisTracker,
44 | opts: SpiderOptions,
45 | ): Promise