Developers Page
As the Unfetter Team grows, we are trying to be more thoughtful in describing what Developers should know.
The below is a list of tools, standards, and processes we follow.
These are the tools we use and how we use them.
- We use GitHub for our version control
- Our main branches are the Master branch and the Develop branch
- The Master branch is where our releases are tagged from.
- The develop branch is where any working code is pushed to. It should not break Unfetter
- We are following the Git Flow process.
- Feature Branches are either named as "issue-" based on the GitHub issue it corresponds to.
- Larger feature branches, that incorporate multiple Issues, can be named "descriptive-title" using "-" to separate words. Don't make it too big.
- Feature Branches are rebased, usually merged onto develop branch.
- Feature branches are merged, via Pull Requests.
- When a PR is approved and merged, we try and use the squash commit options. This gives a cleaner, linear commit history.
- Commit messages should be detailed. If a commit fixes a particular Issue, then the commit message should specifically say " Fixes unfetter-discover/unfetter#issuenumber", which will automatically link the commit to the issue, and will close the issue when that commit is merged to the develop branch.
- We use the GitHub Issue tracker for all issues. All pull requests will have at least one accompanying Issue.
- All issues for Unfetter-Discover are in the Unfetter repo of the Unfetter Discover GitHub organization.
- Unfetter makes use Angular and Typescript for its user interface.
- Components should follow a semblance of the styleguide. Which is loosely enforced by the CLI build tool.
- CSS
- Unfetter uses Angular CLI which uses SASS preprocessor].
- Uses Flex Box.
- Does not use Grid Layout, due to support for older browsers.
- The UI is designed using the Google Material Designs methodology
Unfetter uses Angular CLI to bundle, zip, and transpile its user interface into deployable javascript and assets.
Unfetter is built as a set of Docker containers. Deployment of the multiple containers is orchestrated by Docker Compose
The Docker images extends the Alpine Linux for a minimal footprint
Unfetter uses the NGINX web server to load balance UI asset and micro service requests. If running locally for demo, Unfetter generates self signed SSL certificates. For production deployment, a valid SSL certificate is highly recommended
- Uses RESTful inspired webservices
- API built on the the JSON API standard.
- Uses Node 9.X or 8.X LTS to run its backend web services.
- Uses Swagger to document is forward facing endpoints.
Unfetter uses test driven development methods. More information will be coming.
- Unfetter uses Linting, extending the 'airbnb-base' for its javascript projects.
- Angular CLI UI linting extends Codelyzer.
- There are two Mongo collections. One for all the STIX and MitreAttackPattern data, the other is for configuration of Unfetter.
- Unfetter makes use of Mongodb.
- Here is how you debug node in docker with vs code
- Go to the debug tab
- Click the gear to bring up
launch.json
- Add the following configuration to the list:
{
"type": "node",
"request": "attach",
"name": "unfetter API",
"address": "localhost",
"port": 5555,
"localRoot": "${workspaceRoot}/(place route to unfetter store here)/unfetter-discover-api",
"remoteRoot": "/usr/share/unfetter-discover-api",
"protocol": "inspector"
}
- Create a Github issue in unfetter-discover/unfetter
- From the latest
develop
branch, checkout a new feature branch. Prefix the branch with anissue-
or just give the branch a descriptive name.
git checkout develop
git fetch --all -p && git pull
git checkout -b issue-000
- Edit your files, add them to the index and commit them as you normally would. When adding a commit message you can specify the issue number.
git add .
git commit -m "unfetter-discover/unfetter#<issue-num>"
- Push your files to the remote origin
git push --set-upstream origin issue-000
- Optionally, rebase against the latest develop branch
git checkout develop
git fetch --all -p && git pull
git checkout -
git rebase develop
git status
git push [-f]
- Check lint and tests
npm run lint
npm run test
npm run build:aot:prod # ui only
- Open a Pull Request in the respective project. ie; ui, store, or unfetter Be sure to select
develop
as the base branch andissue-<num>
as the compare branch.
External developers use a Git fork vs. Git branch model. You are welcome to do a Pull Request back to our repo. But please make sure there is an issue that states what is needed and how its done.
Made by NSA Information Assurance