@appland/appmap 3.133.0 → 3.134.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/built/cmds/index/index.js +3 -3
- package/built/cmds/index/index.js.map +1 -1
- package/built/cmds/index/rpc.js +18 -7
- package/built/cmds/index/rpc.js.map +1 -1
- package/built/cmds/navie/help.js +122 -0
- package/built/cmds/navie/help.js.map +1 -0
- package/built/docs/CLA Instructions.pdf +0 -0
- package/built/docs/Code of Conduct for Contributors.pdf +0 -0
- package/built/docs/analysis/rules-reference.html +27 -0
- package/built/docs/appmap-overview.md +54 -0
- package/built/docs/community.md +27 -0
- package/built/docs/diagrams/dependency-map.md +63 -0
- package/built/docs/diagrams/flamegraph.md +91 -0
- package/built/docs/diagrams/how-it-works.md +60 -0
- package/built/docs/diagrams/index.md +20 -0
- package/built/docs/diagrams/sequence-diagram.md +75 -0
- package/built/docs/diagrams/trace-view.md +55 -0
- package/built/docs/guides/configuring-analysis.md +157 -0
- package/built/docs/guides/handling-large-appmaps.md +43 -0
- package/built/docs/guides/index.md +17 -0
- package/built/docs/guides/openapi.md +104 -0
- package/built/docs/guides/reading-sql-in-appmaps.md +67 -0
- package/built/docs/guides/refine-appmaps.md +186 -0
- package/built/docs/guides/reverse-engineering.md +375 -0
- package/built/docs/guides/runtime-code-review.md +108 -0
- package/built/docs/integrations/atlassian-compass.md +24 -0
- package/built/docs/integrations/atlassian-confluence.md +50 -0
- package/built/docs/integrations/docker.md +108 -0
- package/built/docs/integrations/github-actions.md +24 -0
- package/built/docs/integrations/index.md +17 -0
- package/built/docs/integrations/plantuml.md +65 -0
- package/built/docs/integrations/postman.md +29 -0
- package/built/docs/integrations/readme.md +38 -0
- package/built/docs/integrations/smartbear-swaggerhub.md +125 -0
- package/built/docs/navie/bring-your-own-key.md +98 -0
- package/built/docs/navie/demo.md +49 -0
- package/built/docs/navie/how-navie-works.md +26 -0
- package/built/docs/navie/how-to-use-navie.md +152 -0
- package/built/docs/navie/index.md +20 -0
- package/built/docs/reference/analysis-labels.md +48 -0
- package/built/docs/reference/analysis-rules.md +60 -0
- package/built/docs/reference/appmap-agent-js.md +215 -0
- package/built/docs/reference/appmap-client-cli.md +527 -0
- package/built/docs/reference/appmap-gradle-plugin.md +140 -0
- package/built/docs/reference/appmap-java.md +310 -0
- package/built/docs/reference/appmap-maven-plugin.md +163 -0
- package/built/docs/reference/appmap-node.md +185 -0
- package/built/docs/reference/appmap-python.md +395 -0
- package/built/docs/reference/appmap-ruby.md +514 -0
- package/built/docs/reference/github-action.md +164 -0
- package/built/docs/reference/index.md +23 -0
- package/built/docs/reference/jetbrains.md +119 -0
- package/built/docs/reference/license-key-install.md +73 -0
- package/built/docs/reference/remote-recording-api.md +97 -0
- package/built/docs/reference/uninstalling-appmap.md +109 -0
- package/built/docs/reference/vscode.md +125 -0
- package/built/docs/setup-appmap-in-ci/example-projects.md +20 -0
- package/built/docs/setup-appmap-in-ci/how-it-works.md +42 -0
- package/built/docs/setup-appmap-in-ci/in-circleci.md +422 -0
- package/built/docs/setup-appmap-in-ci/in-github-actions.md +176 -0
- package/built/docs/setup-appmap-in-ci/index.md +21 -0
- package/built/docs/setup-appmap-in-ci/matrix-builds.md +224 -0
- package/built/docs/setup-appmap-in-ci/troubleshooting.md +70 -0
- package/built/docs/setup-appmap-in-your-code-editor/add-appmap-to-your-code-editor.md +43 -0
- package/built/docs/setup-appmap-in-your-code-editor/appmap-analysis.md +76 -0
- package/built/docs/setup-appmap-in-your-code-editor/generate-appmaps-from-tests.md +92 -0
- package/built/docs/setup-appmap-in-your-code-editor/generate-appmaps-with-remote-recording.md +111 -0
- package/built/docs/setup-appmap-in-your-code-editor/generate-appmaps-with-request-recording.md +79 -0
- package/built/docs/setup-appmap-in-your-code-editor/how-appmap-works.md +165 -0
- package/built/docs/setup-appmap-in-your-code-editor/index.md +23 -0
- package/built/docs/setup-appmap-in-your-code-editor/navigating-appmaps.md +58 -0
- package/built/docs/setup-appmap-in-your-code-editor/navigating-code-objects.md +66 -0
- package/built/docs/unused_for_now_index.html +11 -0
- package/built/rpc/appmap/stats.js +1 -1
- package/built/rpc/appmap/stats.js.map +1 -1
- package/built/rpc/explain/explain.js +6 -1
- package/built/rpc/explain/explain.js.map +1 -1
- package/built/rpc/explain/navie/navie-local.js +6 -2
- package/built/rpc/explain/navie/navie-local.js.map +1 -1
- package/built/rpc/explain/navie/navie-remote.js +5 -1
- package/built/rpc/explain/navie/navie-remote.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: docs
|
|
3
|
+
title: Docs - Guides
|
|
4
|
+
guides: true
|
|
5
|
+
name: Understanding the Runtime Code Review Report
|
|
6
|
+
step: 8
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Understanding the Runtime Code Review Report <!-- omit in toc -->
|
|
10
|
+
|
|
11
|
+
AppMap Analysis works with your Continuous Integration (CI) system to collect, store, analyze, and report on the behavioral changes within each Pull Request. AppMap analyzes the changes in your application on each pushed commit or pull request. AppMap performs a thorough analysis of the runtime differences, giving you:
|
|
12
|
+
|
|
13
|
+
- Root cause analysis of failed tests.
|
|
14
|
+
- Web service API changes - breaking and non-breaking - via comparison of generated OpenAPI definitions.
|
|
15
|
+
- New and resolved security vulnerabilities.
|
|
16
|
+
- New and resolved performance issues.
|
|
17
|
+
- New and resolved flaws in other categories - maintainability, reliability, and user-defined rules.
|
|
18
|
+
- Code Behavior diffs represented as sequence diagrams showing changed runtime behavior within the PR.
|
|
19
|
+
|
|
20
|
+
<img class="video-screenshot" src="/assets/img/docs/guides/runtime-code-review.webp"/>
|
|
21
|
+
|
|
22
|
+
- [The AppMap Change Report](#the-appmap-change-report)
|
|
23
|
+
- [Summary and Status](#summary-and-status)
|
|
24
|
+
- [Failed Tests](#failed-tests)
|
|
25
|
+
- [API Changes](#api-changes)
|
|
26
|
+
- [Security Flaws](#security-flaws)
|
|
27
|
+
- [Performance Problems](#performance-problems)
|
|
28
|
+
- [Code Anti-Patterns](#code-anti-patterns)
|
|
29
|
+
- [New AppMaps](#new-appmaps)
|
|
30
|
+
|
|
31
|
+
## The AppMap Change Report
|
|
32
|
+
|
|
33
|
+
Once a Pull Request is opened, reopened, or changed, an AppMap Analysis command will run to build a comparison report between the head revision and the most recent base revision for which an AppMap archive is available. This ensures AppMap is only analyzing the code which changed in the pull request. This report compares structural differences observed at runtime between the feature and the origin point of that feature branch. The same action can also add comments and annotations to the source code changes involved in the Pull Request. The report data is also available as a JSON file.
|
|
34
|
+
|
|
35
|
+
Key insights include:
|
|
36
|
+
|
|
37
|
+
- How the new code will impact the system.
|
|
38
|
+
- Any major architectural changes introduced.
|
|
39
|
+
- Changes to the code interactions from API to Database
|
|
40
|
+
|
|
41
|
+
Here is an example of a report from AppMap in CI:
|
|
42
|
+
|
|
43
|
+
<img class="video-screenshot" src="/assets/img/docs/gh-action/analysis-github-action.webp"/>
|
|
44
|
+
|
|
45
|
+
This report shows the runtime analysis done by AppMap, which records code execution behavior *before* those changes are approved for deployment to production.
|
|
46
|
+
|
|
47
|
+
<img class="video-screenshot" src="/assets/img/docs/appmap_CI_report_top.webp"/>
|
|
48
|
+
|
|
49
|
+
## Summary and Status
|
|
50
|
+
|
|
51
|
+
The summary gives you an overview of the following code-related flaws, problems, and anti-patterns.
|
|
52
|
+
|
|
53
|
+
- [Failed Tests](#failed-tests)
|
|
54
|
+
- [API Changes](#api-changes)
|
|
55
|
+
- [Security Flaws](#security-flaws)
|
|
56
|
+
- [Performance Problems](#performance-problems)
|
|
57
|
+
- [Code Anti-Patterns](#code-anti-patterns)
|
|
58
|
+
- [New AppMaps](#new-appmaps)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
### Failed Tests
|
|
62
|
+
|
|
63
|
+
AppMap will report on any tests that failed as part of your test suite. For each test that failed to complete successfully, AppMap will analyze the failed test, showing the full details of the error and the specific part of the test that failed.
|
|
64
|
+
|
|
65
|
+
<img class="video-screenshot" src="/assets/img/docs/appmap_CI_report_failed_tests.webp"/>
|
|
66
|
+
|
|
67
|
+
### API Changes
|
|
68
|
+
|
|
69
|
+
AppMap will report on any changes seen with your API routes at runtime. AppMap will identify changes to routes themselves, notifying you when a new route appears or an existing route is deleted. Additionally, it will identify changes to the response body, content, descriptions, and other attributes.
|
|
70
|
+
|
|
71
|
+
<img class="video-screenshot" src="/assets/img/docs/appmap_CI_report_api_changes.webp"/>
|
|
72
|
+
|
|
73
|
+
### Security Flaws
|
|
74
|
+
|
|
75
|
+
AppMap analyzes your application's behavior to identify new security flaws in how the new code changes execute. AppMap can identify issues such as:
|
|
76
|
+
|
|
77
|
+
- [Deprecated cryptography algorithm](/docs/reference/analysis-rules.html#deprecated-crypto-algorithm)
|
|
78
|
+
- [Logout without Session Reset](/docs/reference/analysis-rules.html#logout-without-session-reset)
|
|
79
|
+
- [Deserialization of untrusted data](/docs/reference/analysis-rules.html#deserialization-of-untrusted-data)
|
|
80
|
+
- and others.
|
|
81
|
+
|
|
82
|
+
For a full list of all the flaws and issues which AppMap can detect, refer to the [Analysis Rules](/docs/reference/analysis-rules) reference section.
|
|
83
|
+
|
|
84
|
+
### Performance Problems
|
|
85
|
+
|
|
86
|
+
AppMap analyzes software behavior changes in your code base to identify performance problems before you merge your code changes. AppMap identifies a variety of software performance problems such as:
|
|
87
|
+
|
|
88
|
+
- [N Plus One SQL Query](/docs/reference/analysis-rules.html#n-plus-one-query)
|
|
89
|
+
- [Slow Function Calls](/docs/reference/analysis-rules.html#slow-function-call)
|
|
90
|
+
- [Slow HTTP Server Requests](/docs/reference/analysis-rules.html#slow-http-server-request)
|
|
91
|
+
- and others.
|
|
92
|
+
|
|
93
|
+
For a full list of all the flaws and issues which AppMap can detect, refer to the [Analysis Rules](/docs/reference/analysis-rules) reference section.
|
|
94
|
+
|
|
95
|
+
### Code Anti-Patterns
|
|
96
|
+
|
|
97
|
+
AppMap can identify any major or potential structural flaws in the architecture, or logical flow that could be introduced due to merging the feature into your application. Some examples of these code anti-patterns that AppMap can identify are:
|
|
98
|
+
|
|
99
|
+
- [Circular Dependencies](/docs/reference/analysis-rules.html#circular-dependency)
|
|
100
|
+
- [Too Many SQL or RPC Updates](/docs/reference/analysis-rules.html#too-many-updates)
|
|
101
|
+
- [SQL Queries from View Layer](/docs/reference/analysis-rules.html#query-from-view)
|
|
102
|
+
- and others.
|
|
103
|
+
|
|
104
|
+
For a full list of all the flaws and issues which AppMap can detect, refer to the [Analysis Rules](/docs/reference/analysis-rules) reference section.
|
|
105
|
+
|
|
106
|
+
### New AppMaps
|
|
107
|
+
|
|
108
|
+
New test cases added to a pull request will lead to new AppMaps being created, with one AppMap created for each new test. AppMap will list all of the new AppMaps (and therefore, each new test) created in each pull request.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: docs
|
|
3
|
+
title: Docs - Integrations
|
|
4
|
+
integrations: true
|
|
5
|
+
name: Atlassian Compass
|
|
6
|
+
step: 1
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Atlassian Compass
|
|
10
|
+
|
|
11
|
+
[Atlassian Compass](https://www.atlassian.com/software/compass) is a developer experience platform that brings your distributed software architecture and the teams collaborating on them together in a single, unified place. [Compass supports visualizing your OpenAPI docs using SwaggerUI](https://community.atlassian.com/t5/Compass-Alpha-articles/Visualize-your-APIs-in-Compass-with-Swagger-UI/ba-p/1814790) integrated into the main Compass application. After adding your application as a new component in Compass, and after enabling the SwaggerUI app, you can now add an additional task to push the `openapi.yml` file to Compass via a webhook.
|
|
12
|
+
|
|
13
|
+
<img class="video-screenshot" src="/assets/img/compass-swagger-ui-config.webp"/>
|
|
14
|
+
|
|
15
|
+
After generating an API username and token, create a step in your GitHub Action (or other CI tool) to push the file to Compass using the custom URL in the configuration page. Make sure to store the webhook URL, API user, and API key as [encrypted secrets in your build task.](https://docs.github.com/en/actions/security-guides/encrypted-secrets)
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
- name: AppMap Generate OpenAPI Definitions
|
|
19
|
+
run: npx @appland/appmap@latest openapi --output-file openapi.yml
|
|
20
|
+
- name: Push OpenAPI to Atlassian Compass
|
|
21
|
+
run: curl -X PUT ${COMPASS_WEBHOOK_URL} -F file=@openapi.yml --user "$COMPASS_API_USER}:${COMPASS_API_KEY}"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
[Refer to the Compass documentation for additional information on how to upload your definitions](https://community.atlassian.com/t5/Compass-Alpha-articles/Visualize-your-APIs-in-Compass-with-Swagger-UI/ba-p/1814790)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: docs
|
|
3
|
+
title: Docs - Integrations
|
|
4
|
+
integrations: true
|
|
5
|
+
name: Atlassian Confluence
|
|
6
|
+
step: 1
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Atlassian Confluence
|
|
10
|
+
|
|
11
|
+
AppMap integrates with [Confluence](https://www.atlassian.com/software/confluence), the popular corporate wiki developed by the Atlassian.
|
|
12
|
+
|
|
13
|
+
Confluence facilitates robust documentation and knowledge sharing. AppMap automatically generates interactive software diagrams from run-time data, ensuring an accurate and up-to-date understanding of code architecture and behavior. This integration leverages the strengths of both platforms enabling teams to better understand, document, and collaborate on their software projects.
|
|
14
|
+
|
|
15
|
+
## Requirements
|
|
16
|
+
|
|
17
|
+
1. A project containing AppMaps.
|
|
18
|
+
- How to make AppMaps [in your code editor](/docs/setup-appmap-in-your-code-editor/)
|
|
19
|
+
- How to make AppMaps [using a GitHub action in CI](/docs/setup-appmap-in-ci/)
|
|
20
|
+
2. [The AppMap app for Confluence](https://marketplace.atlassian.com/apps/1233075/appmap-for-confluence).
|
|
21
|
+
|
|
22
|
+
## Add AppMaps to a Document or Blog Post
|
|
23
|
+
|
|
24
|
+
1. **Enter Edit Mode:** Click the pencil icon to switch to Edit Mode in Confluence.
|
|
25
|
+
<img class="video-screenshot" src="/assets/img/enter-edit-mode.png"/>
|
|
26
|
+
|
|
27
|
+
2. **Attach AppMap File:** Drag and drop the AppMap file from your file system or Finder into the Confluence page.
|
|
28
|
+
<img class="video-screenshot" src="/assets/img/drag-and-drop-appmap.webp"/>
|
|
29
|
+
|
|
30
|
+
3. **Insert AppMap:** Click the plus sign to get the insert menu. Type in and select 'AppMap'.
|
|
31
|
+
<img class="video-screenshot" src="/assets/img/insert-appmap.webp"/>
|
|
32
|
+
A placeholder that looks like this will be added to the page:
|
|
33
|
+
<img class="video-screenshot" src="/assets/img/appmap-placeholder-confluence.png"/>
|
|
34
|
+
|
|
35
|
+
4. **Choose AppMap:** Click the pencil under the placeholder to open the AppMap options.
|
|
36
|
+
<img class="video-screenshot" src="/assets/img/edit-menu-confluence.png"/>
|
|
37
|
+
Select the AppMap you want to display from the dropdown menu and it will render.
|
|
38
|
+
<img class="video-screenshot" src="/assets/img/select-an-appmap-confluence.webp"/>
|
|
39
|
+
<p class="alert alert-info"> If your AppMap does not render, make sure that you are working on a published document. AppMaps will not render until the document has been published at least once</p>
|
|
40
|
+
|
|
41
|
+
5. **Adjust Width (Optional)** The width adjustment controls at the bottom of the AppMap window can be used to view more of the AppMap inline.
|
|
42
|
+
<img class="video-screenshot" src="/assets/img/width-adjustments-confluence.png"/>
|
|
43
|
+
|
|
44
|
+
6. **Save Changes:** Click the 'Update' button to apply the changes to your Confluence page.
|
|
45
|
+
<img class="video-screenshot" src="/assets/img/update-button-confluence.png"/>
|
|
46
|
+
|
|
47
|
+
7. **Fullscreen Mode (Optional):** Click on the 'full screen' icon in the AppMap use Fullscreen mode.
|
|
48
|
+
<img class="video-screenshot" src="/assets/img/full-screen-control-confluence.png"/>
|
|
49
|
+
<p class="alert alert-info"> If at any point you would like some help, <strong><a href="/slack">join us in Slack</a>!</strong> You'll find the AppMap team there, along with other AppMap users.</p>
|
|
50
|
+
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: docs
|
|
3
|
+
title: Docs - Integrations
|
|
4
|
+
integrations: true
|
|
5
|
+
name: Docker
|
|
6
|
+
step: 7
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Docker
|
|
10
|
+
|
|
11
|
+
AppMap supports capturing AppMap recordings from inside a Docker container, when using [Docker Compose](https://docs.docker.com/compose/), or when running [Docker Desktop](https://www.docker.com/products/docker-desktop/).
|
|
12
|
+
|
|
13
|
+
- [Why record AppMaps within Docker?](#why-record-appmaps-within-docker)
|
|
14
|
+
- [Sample Project](#sample-project)
|
|
15
|
+
- [How to run AppMap inside of Docker Engine](#how-to-run-appmap-inside-of-docker-engine)
|
|
16
|
+
- [How to run AppMap inside of Docker Compose](#how-to-run-appmap-inside-of-docker-compose)
|
|
17
|
+
- [Troubleshooting AppMap and Docker](#troubleshooting-appmap-and-docker)
|
|
18
|
+
|
|
19
|
+
## Why record AppMaps within Docker?
|
|
20
|
+
|
|
21
|
+
Recording AppMaps inside a Docker container offers several advantages for developers. Docker's containerization ensures a consistent, reproducible environment across various operating systems, which is crucial for diagnosing and resolving issues that may be environment-specific. This uniformity simplifies the setup process, reduces the time spent on environment configuration, and increases the reliability of recorded AppMaps by mirroring the conditions under which software runs in production or other developers' environments.
|
|
22
|
+
|
|
23
|
+
Overall, using Docker for recording AppMaps streamlines the development workflow, enhances code quality, and fosters collaboration among team members by ensuring that everyone works within an identical development setup.
|
|
24
|
+
|
|
25
|
+
## Sample Project
|
|
26
|
+
|
|
27
|
+
To see an example project using Docker and configured with AppMap, you can see the necessary configuration available on our [sample project on GitHub](https://github.com/land-of-apps/sample_rails_app/).
|
|
28
|
+
|
|
29
|
+
- [Example Dockerfile](https://github.com/land-of-apps/sample_rails_app/blob/main/Dockerfile)
|
|
30
|
+
- [Example docker-compose.yml](https://github.com/land-of-apps/sample_rails_app/blob/main/docker-compose.yml)
|
|
31
|
+
|
|
32
|
+
## How to run AppMap inside of Docker Engine
|
|
33
|
+
|
|
34
|
+
Using the example [Dockerfile](https://github.com/land-of-apps/sample_rails_app/blob/main/Dockerfile) above you need to make sure that you run Docker with the `-v` or `--volume` options in `docker run`.
|
|
35
|
+
|
|
36
|
+
For example to run the application with AppMap enabled in the sample project above, you will need to run:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
> docker run -p 3000:3000 -v $(pwd)/tmp/appmap:/app/tmp/appmap sample_rails_docker bundle exec rails server -b 0.0.0.0
|
|
40
|
+
```
|
|
41
|
+
{: .example-code}
|
|
42
|
+
|
|
43
|
+
Let's breakdown what that command is doing:
|
|
44
|
+
|
|
45
|
+
- `docker run`: Command to create and start a new container.
|
|
46
|
+
- `-p 3000:3000`: Maps port 3000 on the host to port 3000 in the container.
|
|
47
|
+
- `-v $(pwd)/tmp/appmap:/app/tmp/appmap`: Mounts the tmp/appmap directory from the current directory on the host to /app/tmp/appmap in the container for file sharing.
|
|
48
|
+
**NOTE** Update `/app/` in the command to where your application is configured to run.
|
|
49
|
+
- `sample_rails_docker`: The name of the Docker image to use for the container.
|
|
50
|
+
- `bundle exec rails server -b 0.0.0.0`: The command executed within the container to start the application.
|
|
51
|
+
|
|
52
|
+
After recording your AppMaps, you'll now see them in the VS Code or JetBrains extension. The maps will also be visible in your local directory in the `tmp/appmap` folder.
|
|
53
|
+
|
|
54
|
+
<img class="video-screenshot" src="/assets/img/docs/guides/docker-appmaps.webp"/>
|
|
55
|
+
|
|
56
|
+
## How to run AppMap inside of Docker Compose
|
|
57
|
+
|
|
58
|
+
Using the example [docker-compose.yml](https://github.com/land-of-apps/sample_rails_app/blob/main/docker-compose.yml) file in our sample project. Here is the relevant part of the config.
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
services:
|
|
62
|
+
web:
|
|
63
|
+
build: .
|
|
64
|
+
command: bundle exec rails server -b 0.0.0.0
|
|
65
|
+
ports:
|
|
66
|
+
- "3000:3000"
|
|
67
|
+
volumes:
|
|
68
|
+
- ./tmp/appmap:/app/tmp/appmap
|
|
69
|
+
```
|
|
70
|
+
{: .example-code}
|
|
71
|
+
|
|
72
|
+
Let's explain the main part of our relevant configuration.
|
|
73
|
+
|
|
74
|
+
services: Defines the services that make up your application.
|
|
75
|
+
|
|
76
|
+
- `web`: The name of the first (and in this case, only) service.
|
|
77
|
+
- `build: .`: Tells Docker to build the Docker image for the web service using the Dockerfile in the current directory.
|
|
78
|
+
- `command: bundle exec rails server -b 0.0.0.0`: Overrides the default command to start the Rails server, making it accessible from any IP address.
|
|
79
|
+
- `ports: "3000:3000"`: Maps port 3000 on the host to port 3000 in the container, allowing access to the application via localhost:3000.
|
|
80
|
+
- `volumes: ./tmp/appmap:/app/tmp/appmap`: Mounts the tmp/appmap directory from the host into the container at /app/tmp/appmap for file sharing.
|
|
81
|
+
**NOTE** Update `/app/` in the command to where your application is configured to run.
|
|
82
|
+
|
|
83
|
+
You can now run `docker compose up web` to launch this container using Docker Compose. When interacting with the application your maps will be displayed in the VS Code or JetBrains plugin. The maps will also be visible in your local directory in the `tmp/appmap` folder.
|
|
84
|
+
|
|
85
|
+
<img class="video-screenshot" src="/assets/img/docs/guides/docker-file-share.webp"/>
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
## Troubleshooting AppMap and Docker
|
|
89
|
+
|
|
90
|
+
### AppMaps are not visible in plugin with directory correctly mounted
|
|
91
|
+
|
|
92
|
+
You may experience an issue on Linux where you have correctly bind mounted the `tmp/appmap` directory into your Docker container, but are still unable to see the AppMaps in your project.
|
|
93
|
+
|
|
94
|
+
<img class="video-screenshot" src="/assets/img/docs/guides/docker-no-appmaps.webp"/>
|
|
95
|
+
|
|
96
|
+
You can confirm this by looking in the `tmp/appmap` directory in your project file directory listing like in the screenshot below:
|
|
97
|
+
|
|
98
|
+
<img class="video-screenshot" src="/assets/img/docs/guides/docker-maps-directory.webp"/>
|
|
99
|
+
|
|
100
|
+
You can see in that screenshot, a list of AppMap files are visible, and if we opened them in the editor, they would be visible as an AppMap.
|
|
101
|
+
|
|
102
|
+
<img class="video-screenshot" src="/assets/img/docs/guides/docker-open-map.webp"/>
|
|
103
|
+
|
|
104
|
+
When using Docker on Linux, developers might encounter a situation where directories mounted inside a Docker container as bind mounts (using the -v or --volume flag) are owned by the root user. This happens because, by default, Docker runs its containers as the root user, unless specified otherwise. As a result, any files or directories created inside the container on these bind mounts will also be owned by root. Because the AppMap files in `tmp/appmap` are now owned as the `root` user, the AppMap editor extension is unable to index them, which is necessary for them to be visible in the code editor extension.
|
|
105
|
+
|
|
106
|
+
We recommend reviewing the [Docker official documentation regarding bind mounts](https://docs.docker.com/storage/bind-mounts/) for the most up to date information on the permission settings for linux bind mounts.
|
|
107
|
+
|
|
108
|
+
As a Linux user, make sure that the user/group you are running VS Code as also has write access. For more info, refer to [this blog post](https://techflare.blog/permission-problems-in-bind-mount-in-docker-volume/) which goes into detail about Linux, Docker, and file permissions.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: docs
|
|
3
|
+
title: Docs - Integrations
|
|
4
|
+
integrations: true
|
|
5
|
+
name: GitHub Actions
|
|
6
|
+
step: 2
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# GitHub Actions
|
|
10
|
+
|
|
11
|
+
<p class="alert alert-info">
|
|
12
|
+
To get started with the AppMap GitHub Action, <a href="/docs/setup-appmap-in-ci/in-github-actions">refer to the setup documentation</a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
AppMap Analysis can work within GitHub Actions to collect, store, analyze, and report on the behavioral changes within each Pull Request. AppMap will analyze the changes in your application on each pushed commit or pull request. AppMap performs a thorough analysis of the runtime differences, giving you:
|
|
16
|
+
|
|
17
|
+
Root cause analysis of failed tests.
|
|
18
|
+
Web service API changes, both breaking and non-breaking.
|
|
19
|
+
New and resolved security findings.
|
|
20
|
+
New and resolved performance findings.
|
|
21
|
+
New and resolved findings in other categories: maintainability, reliability, and user-defined rules.
|
|
22
|
+
“Behavioral diffs” as sequence diagrams showing changed runtime behavior within the PR.
|
|
23
|
+
|
|
24
|
+
Refer to the [Getting Started with GitHub Actions Documentation](/docs/setup-appmap-in-ci/in-github-actions.html) to learn more about how to integrate GitHub Actions with AppMap
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: docs
|
|
3
|
+
title: Docs - Integrations
|
|
4
|
+
toc: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Integrations
|
|
8
|
+
|
|
9
|
+
AppMap supports integrations with many popular servcies. Learn more about how to integrate AppMap with other services.
|
|
10
|
+
|
|
11
|
+
- [Atlassian Compass](/docs/integrations/atlassian-compass)
|
|
12
|
+
- [Atlassian Confluence](/docs/integrations/atlassian-confluence)
|
|
13
|
+
- [GitHub Actions](/docs/integrations/github-actions)
|
|
14
|
+
- [PlantUML](/docs/integrations/plantuml)
|
|
15
|
+
- [Postman](/docs/integrations/postman)
|
|
16
|
+
- [SmartBear SwaggerHub](/docs/integrations/smartbear-swaggerhub)
|
|
17
|
+
- [Readme.com](/docs/integrations/readme)
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: docs
|
|
3
|
+
title: Docs - Integrations
|
|
4
|
+
integrations: true
|
|
5
|
+
name: PlantUML
|
|
6
|
+
step: 3
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# PlantUML
|
|
10
|
+
|
|
11
|
+
AppMap can generate sequence diagrams in the PlantUML format, a textual format which is portable and easy to modify. This lets you integrate with other tools that support the Mermaid or PlantUML syntax. You can touch up the generated diagrams, and copy-paste the diagram text into a wide variety of tools that support the PlantUML format, such as Atlassian Confluence.
|
|
12
|
+
|
|
13
|
+
There are two ways to generate a PlantUML sequence diagram:
|
|
14
|
+
|
|
15
|
+
1. Run the `sequence-diagram` command with the option `--format plantuml`
|
|
16
|
+
1. Generate a sequence diagram from the code editor. Then locate the sequence diagram file in the file tree, and you’ll see a `<name>.sequence.uml` file.
|
|
17
|
+
|
|
18
|
+
You can copy the file contents directly into other tools, or you can customize it first like. If you are going to edit the PlantUML file, be sure and save it as a new file first.
|
|
19
|
+
|
|
20
|
+
### Generating sequence diagrams from the CLI
|
|
21
|
+
|
|
22
|
+
AppMaps can be generated on the command line from your terminal, or within a CI build.
|
|
23
|
+
|
|
24
|
+
#### CLI command: `sequence-diagram`
|
|
25
|
+
|
|
26
|
+
You can generate sequence diagrams using the AppMap CLI command `sequence-diagram`.
|
|
27
|
+
|
|
28
|
+
An example:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
$ appmap sequence-diagram --format plantuml tmp/appmap/minitest/Following_followers_page.appmap.json
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Comparing sequence diagrams
|
|
35
|
+
|
|
36
|
+
When two AppMaps are similar, it can be useful to represent them as sequence diagrams and then compare them. This is most useful:
|
|
37
|
+
|
|
38
|
+
1. To compare AppMaps of two different test cases, requests, or remote recordings.
|
|
39
|
+
1. To compare two different versions of the same AppMap - before and after a code change.
|
|
40
|
+
|
|
41
|
+
Sequence diagram comparisons can be attached to GitHub Pull Requests to make it easier for reviewers to better understand changes in code.
|
|
42
|
+
|
|
43
|
+
#### CLI command: `sequence-diagram-diff`
|
|
44
|
+
|
|
45
|
+
The `sequence-diagram-diff` command takes two diagram files as arguments, and produces a comparison file of the differences between them. For example:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
$ appmap sequence-diagram-diff --format plantuml user-search-1.sequence.json user-search-2.sequence.json
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Note: this command takes sequence diagram files as arguments, not AppMap files. To convert an AppMap file to sequence diagram format, use this command:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
$ appmap sequence-diagram -f json user-search-1.appmap.json
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
#### Comparing Sequence Diagrams in VS Code
|
|
58
|
+
|
|
59
|
+
Download the PlantUML JAR file from [https://plantuml.com/download](https://plantuml.com/download)
|
|
60
|
+
|
|
61
|
+
Configure the file location:
|
|
62
|
+
|
|
63
|
+
<img class="video-screenshot" src="/assets/img/sequence-diagrams/plant-uml-location.png"/>
|
|
64
|
+
|
|
65
|
+
<img class="video-screenshot" src="/assets/img/sequence-diagrams/compare.png"/>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: docs
|
|
3
|
+
title: Docs - Integrations
|
|
4
|
+
integrations: true
|
|
5
|
+
name: Postman
|
|
6
|
+
step: 4
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Postman
|
|
10
|
+
|
|
11
|
+
After generating your OpenAPI definitions you can import to [Postman](https://www.postman.com/) as a new collection or update an existing collection.
|
|
12
|
+
|
|
13
|
+
To add your OpenAPI definition to Postman start by selecting the _Import_ button found in the top right corner of the Postman UI.
|
|
14
|
+
|
|
15
|
+
<img class="video-screenshot" src="/assets/img/openapi/postman-1.png"/>
|
|
16
|
+
|
|
17
|
+
Next, select the path to where you saved your OpenAPI definition. Alternatively if you have committed the file to a repository or pushed to a 3rd party API hosting service you can select a code repository or link as the location.
|
|
18
|
+
|
|
19
|
+
<img class="video-screenshot" src="/assets/img/openapi/postman-2.webp"/>
|
|
20
|
+
|
|
21
|
+
After Postman validates your OpenAPI definition, you can adjust any advanced settings or accept the default import settings.
|
|
22
|
+
|
|
23
|
+
<img class="video-screenshot" src="/assets/img/openapi/postman-3.png"/>
|
|
24
|
+
|
|
25
|
+
After the import completes you'll see a full tree view of your OpenAPI definitions that were generated by AppMap. You can now use Postman to interact with the APIs.
|
|
26
|
+
|
|
27
|
+
<img class="video-screenshot" src="/assets/img/openapi/postman-4.png"/>
|
|
28
|
+
|
|
29
|
+
Refer to the [Postman documentation](https://learning.postman.com/docs/getting-started/introduction/) for additional details on using Postman to interact with your APIs.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: docs
|
|
3
|
+
title: Docs - Integrations
|
|
4
|
+
integrations: true
|
|
5
|
+
name: Readme
|
|
6
|
+
step: 6
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Readme
|
|
10
|
+
|
|
11
|
+
[Readme](https://readme.com/) is a powerful developer hub that can consume your OpenAPI definition and provide a simple way for users to interact with your API directly from your documentation site or with the included client SDKs that Readme provides.
|
|
12
|
+
|
|
13
|
+
<img class="video-screenshot" src="/assets/img/readme-api-documentation.webp"/>
|
|
14
|
+
|
|
15
|
+
Simply access your Readme administration page, and go to _API Settings_ to add a new endpoint.
|
|
16
|
+
|
|
17
|
+
<img class="video-screenshot" src="/assets/img/readme-github-action.webp"/>
|
|
18
|
+
|
|
19
|
+
Add the relevant commands to your GitHub Action or your CI system. Make sure to save the Readme API key as an [encrypted secret in your build task.](https://docs.github.com/en/actions/security-guides/encrypted-secrets)
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
- name: Install rdme
|
|
23
|
+
run: npm install rdme@latest -g
|
|
24
|
+
- name: Install AppMap tools
|
|
25
|
+
uses: getappmap/install-action@v1
|
|
26
|
+
- name: AppMap Generate OpenAPI Definitions
|
|
27
|
+
run: appmap openapi --output-file openapi.yml
|
|
28
|
+
- name: Push OpenAPI to Readme
|
|
29
|
+
run: rdme openapi openapi.yml --version=v1.0 --key="${{ secrets.RDME_KEY }}"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
After your build job completes you'll see your API imported into Readme.
|
|
33
|
+
|
|
34
|
+
<img class="video-screenshot" src="/assets/img/readme-openapi-imported.png"/>
|
|
35
|
+
|
|
36
|
+
And when navigating into any of your API endpoints, you'll see notifications that this API is _synced from Swagger.
|
|
37
|
+
|
|
38
|
+
<img class="video-screenshot" src="/assets/img/readme-openapi-synced.png"/>
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: docs
|
|
3
|
+
title: Docs - Integrations
|
|
4
|
+
integrations: true
|
|
5
|
+
name: SmartBear SwaggerHub
|
|
6
|
+
render_with_liquid: false
|
|
7
|
+
step: 5
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# SmartBear SwaggerHub and Portal
|
|
11
|
+
|
|
12
|
+
[SwaggerHub](https://swagger.io/tools/swaggerhub/) is a centralized API design tool which allows teams to collaborate on API design and enforce style, quality, and consistency of their APIs.
|
|
13
|
+
|
|
14
|
+
[SwaggerHub Portal](https://swagger.io/tools/swaggerhub/features/swaggerhub-portal/) let's you synchronize your API designs from SwaggerHub into a customized portal which creates comprehensive and easy to use API documentation for your users and customers.
|
|
15
|
+
|
|
16
|
+
AppMap supports multiple use-cases when integrating AppMap and SwaggerHub.
|
|
17
|
+
- [Generate Code-First OpenAPI and Publish to SwaggerHub](#generate-code-first-openapi-and-publish-to-swaggerhub)
|
|
18
|
+
- [Disable Deployment when Runtime OpenAPI Diverges from SwaggerHub API](#disable-deployment-when-runtime-openapi-diverges-from-swaggerhub-api)
|
|
19
|
+
|
|
20
|
+
## Generate Code-First OpenAPI and Publish to SwaggerHub
|
|
21
|
+
|
|
22
|
+
AppMap supports the integration of it's automatic code-first OpenAPI documentation functionality directly into the SwaggerHub platform by leveraging the [SwaggerHub CLI](https://github.com/SmartBear/swaggerhub-cli) and GitHub Actions. Using AppMap, you can automated interact with your API routes via a GitHub action, AppMap will automatically capture details about those API route interactions and export them into OpenAPI supported formats. From there, you can use the SwaggerHub CLI to push these APIs directly to SwaggerHub and Portal.
|
|
23
|
+
|
|
24
|
+
### Configuration
|
|
25
|
+
|
|
26
|
+
First, access your API key on the [user settings page](https://app.swaggerhub.com/settings/apiKey) in SwaggerHub. When using GitHub Actions, you'll want to save this API key as a [action secret](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions) named `SWAGGERHUB_API_KEY`.
|
|
27
|
+
|
|
28
|
+
Add the relevant commands to your GitHub Action or your CI system. Make sure you export the SwaggerHub API key as a build environment variable in the action.
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
env:
|
|
32
|
+
SWAGGERHUB_API_KEY: ${{ secrets.SWAGGERHUB_API_KEY }}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
- name: Install SmartBear CLI
|
|
37
|
+
run: npm i -g swaggerhub-cli
|
|
38
|
+
- name: Install AppMap tools
|
|
39
|
+
uses: getappmap/install-action@v1
|
|
40
|
+
|
|
41
|
+
- name: Set API Version Number
|
|
42
|
+
run: echo "OPENAPI_VERSION"=$(cat openapi-version) >> "$GITHUB_ENV"
|
|
43
|
+
|
|
44
|
+
- name: Generate OpenAPI with AppMap
|
|
45
|
+
run: appmap openapi --output-file openapi.yml --openapi-title <repo name> --openapi-version ${OPENAPI_VERSION}
|
|
46
|
+
|
|
47
|
+
- name: Publish API to SmartBear
|
|
48
|
+
run: swaggerhub api:create <swaggerhub team>/<repo name> --file openapi.yml
|
|
49
|
+
|
|
50
|
+
- name: Set Latest API Default
|
|
51
|
+
run: swaggerhub api:setdefault <swaggerhub team>/<repo name>/${OPENAPI_VERSION}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Refer to [this project on GitHub](https://github.com/land-of-apps/rails_tutorial_sample_app_7th_ed/blob/smartbear-integration/.github/workflows/openapi-publish.yml) for a fully working example of this GitHub Action.
|
|
55
|
+
|
|
56
|
+
After your build job completes, you'll see your latest version of your API imported into SwaggerHub.
|
|
57
|
+
|
|
58
|
+
<img class="video-screenshot" src="/assets/img/swaggerhub-api.webp"/>
|
|
59
|
+
|
|
60
|
+
Next, navigate to your SwaggerHub Portal administration page, select on your project and find the latest release of the uploaded API.
|
|
61
|
+
|
|
62
|
+
<img class="video-screenshot" src="/assets/img/swaggerhub-portal-link.webp"/>
|
|
63
|
+
|
|
64
|
+
When you are ready to publish this API to your users and customers, simply click the "Link API" button.
|
|
65
|
+
|
|
66
|
+
<img class="video-screenshot" src="/assets/img/swaggerhub-publish.webp"/>
|
|
67
|
+
|
|
68
|
+
After it's published, you'll see the latest revision now available in your SwaggerHub Portal
|
|
69
|
+
|
|
70
|
+
<img class="video-screenshot" src="/assets/img/swaggerhub-portal.webp"/>
|
|
71
|
+
|
|
72
|
+
### Demo
|
|
73
|
+
|
|
74
|
+
<div style="position: relative; padding-bottom: 56.25%; height: 0;"><iframe src="https://www.loom.com/embed/b36735e6254a4a13a824c827a3390efb" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe></div>
|
|
75
|
+
|
|
76
|
+
## Disable Deployment when Runtime OpenAPI Diverges from SwaggerHub API
|
|
77
|
+
|
|
78
|
+
Because we are going to be using the SwaggerHub CLI inside of our CI/GitHub action
|
|
79
|
+
|
|
80
|
+
### Configuration
|
|
81
|
+
Because we are going to be using the SwaggerHub CLI inside of our CI/GitHub action you'll need to store the API key as an [encrypted secret](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions) in your GitHub action.
|
|
82
|
+
|
|
83
|
+
Access your API key on the [user settings page](https://app.swaggerhub.com/settings/apiKey) in SwaggerHub. Store this as an encrypted secrete named `SWAGGERHUB_API_KEY`.
|
|
84
|
+
|
|
85
|
+
Add the relevant commands to your GitHub Action or your CI system. Make sure you export the SwaggerHub API key as a build environment variable in the action.
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
env:
|
|
89
|
+
SWAGGERHUB_API_KEY: ${{ secrets.SWAGGERHUB_API_KEY }}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
- name: Install SmartBear CLI
|
|
94
|
+
run: npm i -g swaggerhub-cli
|
|
95
|
+
- name: Install AppMap tools
|
|
96
|
+
uses: getappmap/install-action@v1
|
|
97
|
+
|
|
98
|
+
- name: Set API Version Number
|
|
99
|
+
if: always()
|
|
100
|
+
run: echo "OPENAPI_VERSION"=$(cat openapi-version) >> "$GITHUB_ENV"
|
|
101
|
+
|
|
102
|
+
- name: Generate OpenAPI with AppMap
|
|
103
|
+
run: appmap openapi --output-file openapi.yml --openapi-title <repo name> --openapi-version ${OPENAPI_VERSION}
|
|
104
|
+
|
|
105
|
+
- name: Get Latest Default
|
|
106
|
+
if: always()
|
|
107
|
+
run: swaggerhub api:get <swaggerhub team>/<repo name> > swaggerhub-api.yml
|
|
108
|
+
|
|
109
|
+
- name: Normalize OpenAPI Files
|
|
110
|
+
if: always()
|
|
111
|
+
run: cat openapi.yml | sed '/^$/d' > openapi-clean.yml && cat swaggerhub-api.yml | sed '/^$/d' > swaggerhub-clean.yml
|
|
112
|
+
|
|
113
|
+
- name: Compare Actual vs SwaggerHub
|
|
114
|
+
if: always()
|
|
115
|
+
run: diff openapi-clean.yml swaggerhub-clean.yml
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Refer to [this project on GitHub](https://github.com/land-of-apps/rails_tutorial_sample_app_7th_ed/blob/smartbear-api-comparison/.github/workflows/openapi-compare.yml) for a fully working example of this GitHub Action.
|
|
119
|
+
|
|
120
|
+
With this configuratino enabled, when a user makes a commit which changes the routes that are NOT currently in the published API spec on SwaggerHub this build will fail and the user will be unable to deploy unless they update the API spec on SwaggerHub or remove the offending changes.
|
|
121
|
+
|
|
122
|
+
<img class="video-screenshot" src="/assets/img/swaggerhub-github-build-failure.webp"/>
|
|
123
|
+
|
|
124
|
+
### Demo
|
|
125
|
+
<div style="position: relative; padding-bottom: 56.25%; height: 0;"><iframe src="https://www.loom.com/embed/f51d590a46e8493ebb27be33c63328e6" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe></div>
|