Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4ea1a94
feat: Build AppMap archive
kgilpin Mar 15, 2023
0f36e2e
refactor: Move fileSizeFilter to its own file
kgilpin Mar 16, 2023
494a48a
feat: Restore AppMaps from available archives
kgilpin Mar 16, 2023
38cff99
feat: Update AppMaps by running out of date tests
kgilpin Mar 16, 2023
61c1c23
wip: Add out-of-date AppMaps to the test run
kgilpin Mar 16, 2023
4e67c6b
test: Fix OpenAPI spec
kgilpin Mar 17, 2023
2428e56
fix: Fingerprint an empty directory
kgilpin Mar 17, 2023
28f5dfa
misc: Scripts to build archives of known repos
kgilpin Mar 17, 2023
a1280b9
feat: Update archive/restore/update commands
kgilpin Mar 18, 2023
fd5397a
feat: Describe a commit by comparing seq diagrams
kgilpin Jan 4, 2023
34e6f21
feat: Print revision change report
kgilpin Jan 5, 2023
5bdeb25
feat: Remove unused actors
kgilpin Jan 6, 2023
b4b9f02
feat: Re-process change data
kgilpin Jan 6, 2023
b06a28f
feat: Improve the describe-change workflow
kgilpin Jan 19, 2023
3417aac
feat: Generate png of sequence diagram
kgilpin Feb 27, 2023
f13778c
feat: Render sequence diagram natively as PNG
kgilpin Mar 1, 2023
6b01177
wip: Remove report prompts; link to live diagrams rather than images
kgilpin Mar 3, 2023
750269a
wip: Organize changes by API operation
kgilpin Mar 3, 2023
607e140
wip: Normalize diagrams to contain only user code
kgilpin Mar 4, 2023
e112bfe
wip: Filter sequence diagrams
kgilpin Mar 6, 2023
a7320ff
wip: Compute changes on per-operation basis
kgilpin Mar 6, 2023
a43610f
fixup! wip: Compute changes on per-operation basis
kgilpin Mar 7, 2023
7f5f35e
feat: List failed tests and print their logs
kgilpin Mar 7, 2023
795a804
fix: Fix some merge conflicts
kgilpin Mar 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions packages/cli/contrib/build_appland_archive
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/env ruby

require 'fileutils'

revision = ARGV[0]
no_test = true if ARGV[1..-1].member?('--no-test')

cli_dir = Dir.pwd

sys_command = ->(cmd, env = nil) do
Array(cmd).each do |c|
args = [ env, c ].compact
p args
system *args or raise "Command failed: #{c}"
end
end

node_version = `node -v`
raise "Node version should be 16, got #{node_version}" unless node_version.index('v16.')

Dir.chdir File.expand_path('~/source/appland/appland')
appland_dir = Dir.pwd

required_ruby_version = File.read('.ruby-version').strip
ruby_version = `ruby -v`
raise "Ruby version must be #{required_ruby_version}, is #{ruby_version}" unless ruby_version.index(required_ruby_version)

sys_command.call [
"git checkout #{revision}",
]

unless no_test
sys_command.call 'git lfs track "*.tar"' \
unless File.read('.gitattributes').index('*.tar filter=lfs diff=lfs merge=lfs -text')

env = `bundle exec rake dev:db`.split("\n").select { |line| line.index('=') }.map { |line| k, v = line.split('='); [ k['export '.length..-1], v] }.to_h

FileUtils.rm_rf 'tmp/appmap'
FileUtils.mkdir_p 'tmp/appmap/rspec'
FileUtils.mkdir_p '.appmap/archive/full'

sys_command.call [
'npm install',
'./bin/webpack',
'psql -U postgres -h localhost -c "create database appland_test" || true',
'rails db:migrate',
'rails db:test:prepare',
'bundle exec rspec'
], env.merge('RAILS_ENV' => 'test', 'DISABLE_SPRING' => 'true')
end

Dir.chdir cli_dir

system "node ./built/src/cli.js archive"
61 changes: 61 additions & 0 deletions packages/cli/contrib/build_rails_sample_app_6th_ed_archive
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/usr/bin/env ruby

require 'fileutils'

revision = ARGV[0]
no_test = true if ARGV[1..-1]&.member?('--no-test')

cli_dir = Dir.pwd

sys_command = ->(cmd, env = nil) do
Array(cmd).each do |c|
args = [ env, c ].compact
p args
system *args or raise "Command failed: #{c}"
end
end

node_version = `node -v`
raise "Node version should be 14, got #{node_version}" unless node_version.index('v14.')

Dir.chdir File.expand_path('~/source/land-of-apps/sample_app_6th_ed')
project_dir = Dir.pwd

required_ruby_version = '2.7.3'
ruby_version = `ruby -v`
raise "Ruby version must be #{required_ruby_version}, is #{ruby_version}" unless ruby_version.index(required_ruby_version)

sys_command.call [
"git checkout #{revision}",
]

unless no_test
sys_command.call 'git lfs track "*.tar"' \
unless File.read('.gitattributes').index('*.tar filter=lfs diff=lfs merge=lfs -text')

File.write 'appmap.yml', <<~APPMAP_CONFIG
name: sample_app_6th_ed
language: ruby
appmap_dir: tmp/appmap
packages:
- path: app
- path: lib
APPMAP_CONFIG

FileUtils.rm_rf 'tmp/appmap'
FileUtils.mkdir_p 'tmp/appmap/minitest'
FileUtils.mkdir_p '.appmap/archive/full'

sys_command.call [
'bundle update mimemagic puma',
'bundle info appmap || bundle add appmap',
'bundle update appmap',
'yarn install',
'rails db:test:prepare',
'rails test'
], { 'RAILS_ENV' => 'test', 'DISABLE_SPRING' => 'true' }
end

Dir.chdir cli_dir

system "node ./built/src/cli.js archive -d #{project_dir}"
1 change: 1 addition & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"@appland/sequence-diagram": "workspace:^1",
"@sidvind/better-ajv-errors": "^0.9.1",
"@types/moo": "^0.5.5",
"@zip.js/zip.js": "^2.6.75",
"JSONStream": "^1.3.5",
"ajv": "^8.6.3",
"applicationinsights": "^2.1.4",
Expand Down
8 changes: 8 additions & 0 deletions packages/cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ const SequenceDiagramCommand = require('./cmds/sequenceDiagram');
const SequenceDiagramDiffCommand = require('./cmds/sequenceDiagramDiff');
const StatsCommand = require('./cmds/stats/stats');
import UploadCommand from './cmds/upload';
const BuildArchive = require('./cmds/archive/archive');
const RestoreArchive = require('./cmds/archive/restore');
const UpdateAppMaps = require('./cmds/update');
const DescribeChange = require('./cmds/describeChange');

class DiffCommand {
public appMapNames: any;
Expand Down Expand Up @@ -455,6 +459,10 @@ yargs(process.argv.slice(2))
.command(SequenceDiagramDiffCommand)
.command(PruneCommand)
.command(UploadCommand)
.command(DescribeChange)
.command(BuildArchive)
.command(RestoreArchive)
.command(UpdateAppMaps)
.strict()
.demandCommand()
.help().argv;
14 changes: 14 additions & 0 deletions packages/cli/src/cmds/archive/Metadata.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { AppMapConfig } from '../../lib/loadAppMapConfig';

export type Metadata = {
versions: Record<string, string>;
workingDirectory: string;
appMapDir: string;
commandArguments: Record<string, string | string[]>;
baseRevision?: string;
revision: string;
timestamp: string;
oversizedAppMaps: string[];
deletedAppMaps?: string[];
config: AppMapConfig;
};
Loading