📄️ 0000 Server Framework
The Personal Property Prototype project needs an API and services in place to support
📄️ 0001 Go ORM
3M will have include evolving data structures that we anticipate will change significantly throughout development.
📄️ 0002 Go package management
NOTE: Golang has explicitly moved to go mod and this project has as well, making this ADR obsolete.
📄️ 0003 Go path and project layout
The server component of mymove is written in Go. Go is very particular about where source code can live to allow for a standard way of fetching and building dependencies. We need to decide how we want to build the server, and how to fit into the go ecosystem to do so.
📄️ 0004 Use Both Absolute and Relative Paths for Imports
Imports should be as easy to use and consistent as possible across the project.
📄️ 0005 Use Create React App
After landing on our decision to use React for this project, we wanted a template to start from that would provide as many sane defaults as possible.
📄️ 0006 Use Redux
In React, though parent components can pass information to their children components, it's atypical for children components to pass information to parent components. This makes it difficult to handle state that is consistent across multiple components (such as authentication and authorization). Doing so using only React causes a loss in modularity.
📄️ 0007 Use swagger-client to make calls to API from client
User Story: [#153793371]
📄️ 0008 Use go-swagger To Route, Parse, And Validate API Endpoints
Considered Alternatives
📄️ 0009 Generate forms from swagger definitions of payload
User Story: #154407746
📄️ 0010 Isolate Test Access to Database
NOTE: This ADR has been superseded by ADR0062 Run Tests in Transactions.
📄️ 0011 Test Suites
User Story: 155076695
📄️ 0012 The TSP Data Models
User Story: 155524224
📄️ 0013 REST API Updates
A large part of the functionality of the system is exposed as a RESTful
📄️ 0014 Go Dependency Management
Our code depends on other code. Handlers need database connections, the auth handlers need to know our URL. There has to be a way for code to get access to its dependencies, we have chosen to go down an explicit route where code is initialized with all its dependencies passed into the initializer. This makes our dependency tree very explicit and makes testing individual components easier.
📄️ 0015 Session storage/handling
User Story: 155140012
📄️ 0016 Browser Support for Prototype
User Story: 155599293
📄️ 0017 Client side route restriction based on authentication
User Story: #155131945
📄️ 0018 Optional Field Interop
Some of the fields in our API are optional. go-swagger represents optional fields using pointers, if the field is not present, the pointer is set to null. Pop (and the go database package in general) supports using pointers to represent null but are more geared toward using a special nullable field struct (NullString, NullInt, etc) where the struct has value and valid fields. The valid field indicates whether the optional field is present.
📄️ 0019 Range Slider React Component
User Story: #155911084
📄️ 0020 Using Swagger to manage server route authentication
Stick with what we have
📄️ 0021 Temporary use and plan for expunging Social Security Numbers in the prototype
Using SSNs temporarily
📄️ 0022 Chose Excelize package to parse XLSX files
Use Excelize
📄️ 0023 Representing Dollar Values in Go and the Database
Represent dollar values as cents (integers)
📄️ 0024 Model Authorization and Handler Design
Multiple decision outcomes
📄️ 0025 Client Side Feature Flags using Custom JavaScript
Decision outcome: Detect current environment using NODE_ENV and fallback to using the hostname when in production. Toggle features based on this environment.
📄️ 0026 Use Snyk Vulnerability Scanning
Status: Accepted
📄️ 0027 PDF Generation
Decision outcome: Unknown
📄️ 0028 Config Management
Decision outcome: Viper & pflag
📄️ 0029 Honeycomb Integration
Decision outcome: Honeycomb was deprecated and removed from this project as it was never fully used for instrumentation.
📄️ 0030 IAM Authentication for Database
Decision outcome: External IAM Authentication Provider
📄️ 0031 CSS Tooling
Decision outcome: Sass with CSS Modules
📄️ 0032 CSRF Protection for the Application
Decision outcome: Double-submit cookie method with gorilla/csrf
📄️ 0033 Service Object Layer
Decision outcome: Adopt service object layer, an architectural pattern for writing code that allows for encapsulation of logic, code re-usability, ultimately keeping our handler code much less complex and more lightweight.
📄️ 0034 Working With Mocks: Generation and Assertion
Decision outcome: Use Mockery and Testify
📄️ 0035 Use Query Builder for Admin Interface
Decision outcome: Write a generic query builder
📄️ 0036 Use Separate Integration Package for Go Integration Tests
Decision outcome: Move integration tests to separate package and flag the suite with testing.Short
📄️ 0037 Put mymove outside of standard GOPATH
Decision outcome: Move repository outside of $GOPATH and explicitly set GO111MODULE=auto.
📄️ 0038 Use Soft Delete Instead of Hard Delete
Decision outcome: Introduce soft deletion into the system
📄️ 0039 Use React Lazy for code splitting
Decision outcome: Use React Lazy
📄️ 0040 Add Role-Based Authorization
Decision outcome: Implement Role-Based Access Control in Middleware
📄️ 0041 Front End Form Library
Decision outcome: Choose Formik
📄️ 0042 Use If-Match / E-tags for optimistic locking
Decision outcome: Use E-tags for optimistic locking
📄️ 0043 Handling time in the Prime API
Definitions
📄️ 0044 Use camelCase for API params
All API params should use the same style of casing (camel, snake, kebab, etc.)to maintain consistency across the code base.
📄️ 0045 Nesting Swagger paths in the Prime API with multiple IDs
The Prime API manages Move Task Orders and the child objects for these orders, such as shipments and payment requests.
📄️ 0046 Use nodenv to manage Node versions in development
Replaced by ADR 0081
📄️ 0047 Use CircleCI to build only Pull Requests and master
Currently our CircleCI costs are very high, well over the initial expected budget. By default CircleCI builds every branch regardless of if it has a Pull Request (PR) or not. Given the size of the MilMove team and our typical pattern of creating branches in the main repo this results in a large number of builds. The builds are also triggered every time a branch changes, which can be quite frequent on active development branches.
📄️ 0048 Use a consistent file structure for front-end code
Currently, the front end code is in a state of mid-reorganization from one file structure to another. However, without a specific plan in place, this reorganization risks losing momentum, and over time could result in the code being indefinitely split between two different file structures. This makes future work on this codebase more confusing and increases the risk for mistakes to be made. Therefore, the purpose of this ADR is to establish a plan and certain guidelines for moving the reorganization forward, hopefully at an increased pace.
📄️ 0049 Do not update child records using parent's E-tag
User Story: Jira Story
📄️ 0050 Fork & maintain react-file-viewer under @trussworks
User Story: MB-2346 Orders Document viewer (PDF)
📄️ 0051 Use only Swagger supported formats for dates
In our Swagger yaml files we should only be using date formats that are supported by Swagger.
📄️ 0052 Use data-testid as an attribute for finding components in tests
Jira Story
📄️ 0053 Use React Query for Office App API interactions
We are currently making heavy use of Redux in both the Office app & customer-facing app to manage API data in the browser. While there are other valid reasons to continue using Redux, it does put a lot of overhead on our code to handle fetching data, providing the correct data to the correct UI components, and deciding when to invalidate or re-fetch data that has become stale. This article (Why I Quit Redux) explains pretty well why this is less than ideal, and also proposes using a library called React Query as an alternative.
📄️ 0054 Use CSS to highlight unfinished features
For the MilMove demo on 8/4/2020, the decision was made to use a feature flag to conceal unfinished work, in order to reduce confusion on the part of the client as to what work was complete vs. not yet finished. The MilMove project encountered a similar issue in 2018 and decided to use a low-lift solution of highlighting unfinished work with a yellow background via a CSS class applied to UI elements. This decision resulted in increasing transparency around feature status, lowering confusion, and helped improve overall client communication around project progress.
📄️ 0055 Consolidate moves and move task orders into one database table
Jira Epic
📄️ 0056 Use ASDF To Manage Golang Versions In Development
Replaced by ADR 0081
📄️ 0057 Deprecate use of lodash over time
We are currently using the utility library lodash throughout the frontend codebase. However, many of the methods provided by lodash have been superseded by native ES6+ methods. Even the latest ECMAScript functionality that is not natively supported by our target browsers (such as IE11) will be transpiled and/or polyfilled with our existing Webpack & Babel configuration. Continuing to use lodash methods as-is has two negative effects:
📄️ 0058 Use Happo for visual regression testing
Background
📄️ 0059 Use snapshot to cleanup load testing
User Story: Jira Story
📄️ 0060 Move statuses to support service counseling
User Story: Create new move "status" for Services Counseling
📄️ 0061 Use OpenTelemetry to instrument code for distributed tracing
User Story: Distributed Tracing ADR
📄️ 0062 Run tests within transactions
NOTE: This ADR updates and supersedes ADR0010 Isolate Test Access to Database.
📄️ 0063 Using openapi CLI to compile API specs
Problem Statement
📄️ 0064 Use stateless services with context
Problem statement
📄️ 0065 Use Office application for Prime UI
- Epic Story: MB-8515
📄️ 0066 Use custom nullable types for patch requests
User Story: MB-10592
📄️ 0067 Add a child table to mto_shipments for PPMs
User Story: MB-11140
📄️ 0068 Use fake data factories with fake data generators to create test data
Problem statement
📄️ 0069 Use orchestrator service objects
NOTE: ADR 0033 Service Object Layer is the one that started us on using service
📄️ 0070 Use a consistent file structure for cypress tests
In the MilMove code base there is a previous iteration of PPM code and related cypress tests. Those older cypress tests were in two files cypress/integration/mymove/ppm.js and cypress/integration/mymove/ppmCloseout.js. These tests, before they were commented out, were long and later portions were dependent on earlier ones which occasionally caused failures that were difficult to find.
📄️ 0071 Introduce Move History Events
- 🔒 User Story: MB-8115
📄️ 0072 Using React-App-Rewired
Decision outcome: Dynamically patch the configurations
📄️ 0073 Use Templates for SQL Queries
Decision outcome: Establish a pattern for SQL query template artifacts
📄️ 0074 Refactor Move Event's Details Rendering
🔒 User Story: MB-11214
📄️ 0075 Remove CLI Spinner
A CLI spinner is a spinner that appears on the command line interface to visually indicate that the program being run is working on a task.
📄️ 0076 Partial Update Patches
🔒 User Story: MB-14102
📄️ 0076 Convert integration tests to Playwright
Background
📄️ 0077 Permanently store Origin Duty Location GBLOC
Decision outcome: Add a column to the orders table for Origin Duty Location GBLOC
📄️ 0078 API Versioning
How to implement API Versioning
📄️ 0079 Update strategy for maintaining code test coverage
Decision outcome: The Happo Approach
📄️ 0080 API Versioning Code Organization
How to implement API Versioning
📄️ 0081 Use ASDF to Manage Node and Golang versions in Development
This ADR supersedes ADR-0046 and ADR-0056
📄️ 0082 Use Flipt for Feature Flags
Feature Flags enable CI/CD and roll-forward recovery. The question isn't "why?", but "how?"
📄️ 0083 Deprecating `devseed` Scenarios
A description for ADR 0083
📄️ 0084 Deploy Flipt using ECS service discovery
An ADR about how we deploy Flipt using AWS ECS service discovery.