presentation | ||||||
---|---|---|---|---|---|---|
|
Who, what, why, where, how
or how I learned to stop hiding; and expose the bomb
This slide-deck: https://offscale.io/cse-07-19.html
Open-source means freedom.
Freedom to share code, usually commercially and privately.
digraph G {
bgcolor=transparent;
rank=same
node[style=filled, shape=rect, color=dodgerblue2, fontcolor=white, fontsize=18, fontname=Helvetica];
edge[arrowhead=vee, color=white, fontsize=18, fontcolor=navy];
public[label="Public domain", color=black]
mit[label="MIT"]
BSD[label="BSD-New"]
apache[label="Apache-2.0", shape=rect]
node[color=darkolivegreen2, fontcolor=black];
lgpl2[label="LGPL 2.1"]
lgpl2p[label="LGPL ≥ 2.1"]
lgpl3[label="LGPL ≥ 3"]
mpl[label="MPL 1.1"]
node[color=darkgoldenrod1];
gpl2[label="GPL 2"]
gpl2p[label="GPL 2+"]
gpl3[label="GPL ≥ 3"]
node[color=coral1];
agpl[label="AGPL 3"]
subgraph permissive {
public mit -> BSD -> apache
}
subgraph weak {
lgpl2 lgpl2p lgpl3 mpl
}
subgraph strong {
label=strong
color=lightblue
style=filled
gpl2 gpl2p gpl3
}
subgraph network {
agpl
}
BSD -> lgpl2
BSD -> lgpl2p
apache -> lgpl3
lgpl2 -> gpl2
lgpl2 -> gpl2p
lgpl2p -> gpl2
lgpl2p -> lgpl2 [dir=both]
lgpl3 -> gpl3
BSD -> mpl
gpl3 -> agpl
}
- Development speed
- Quality (tests; security;
documentation) - Interoperability
- Community
- Learning
- Auditability & accountability
- Mesosphere raised $125M ($247M to date)
- Hashicorp raised $100M ($174.2M to date)
- CoreOS bought for $250M by Red Hat
- Red Hat bought for $34B by IBM
- Pick a license;
- Pick a name;
- Create a repository;
- Upload repository (e.g.: to GitHub)
- Pick a project;
- Pull it to local computer [usually];
- Make modifications;
- Send back modifications
New to programming, or a nonprogrammer?
No matter. Plenty of low-hanging fruit; even for you!
(see appendix for details)
github.com/SamuelMarks github.com/offscale [email protected] /in/samuelmarks
- README.md cleanup (the first document the public views);
- Spell checking;
- Linting (semicolons, tabs vs. spaces, &etc.);
- Badges/shields, like:
- Code quality metrics (automated, e.g.: with CI/CD integration)
- Code coverage
- Test coverage
- Dotfiles: adding these to the root of the repository increases quality:
.gitignore
;.editorconfig
- Compliance (e.g.: PEP8 in Python; strict-mode in ECMAScript)
- Writing simple tests
- Writing tests
- Static code analysis with tooling, e.g.: what opening a project with a JetBrains IDE, selecting "Code"->"Inspect Code..." from the menu bar will expose
- CI/CD integration (Azure Pipelines; Travis CI; Appveyor and/or CircleCI)
- See next slide
# Filename: .travis.yml
language: node_js
node_js:
- "lts/*"
cache:
npm: true
before_install:
- npm install -g npm
install:
- npm ci
script:
- tsc
- npm test
after_success:
- npm run coverage
- Interoperability, e.g.:
- OS support for: Windows, Linux, macOS, FreeBSD
- Language support for: Python 2 & 3 [not as relevant anymore!]; newer/older JS
- Package support for application-level dependency managers, e.g.:
- Python:
setup.py
; Node.js:package.json
; Rust:Cargo.toml
- Python:
- Docker integration
- See next slide
# Filename: Dockerfile
# Use Node.js' long-term support release
FROM node:lts-alpine
# Copy source code
COPY . /app
# Change working directory
WORKDIR /app
# Install dependencies
RUN npm ci
# Expose API port to the outside
EXPOSE 80
ENTRYPOINT ["npm", "start"]
- Bots to automate changes, from small things like updating dependencies, to large things like modifying a codebase through AST traversals
- Major contributions to large codebases, e.g.: adding strict resource limits to FreeBSD jails by modifying the kernel
- Create an account on https://github.com
- Pick a project, e.g.: from https://github.com/explore
This is generally dubbed a fork.
Most commonly, forks are used to either propose changes to someone else's project or to use someone else's project as a starting point for your own idea.
- Install
git
: https://git-scm.com/downloads - Open your terminal / command prompt
- Run
git clone
followed by the URL of the repository, e.g.:
git clone https://github.com/SamuelMarks/restify-orm-scaffold
- Modify (e.g.: using the CLI, an IDE, manually modifying using a GUI file manager)
- On the command-line,
cd
into the directory youclone
d - Run:
git config --global user.name "FIRST_NAME LAST_NAME"
git config --global user.email "[email protected]"
- Create a feature branch with:
git checkout -b feature_name_goes_here
- See your modifications with:
git status
- Add your modifications by specifying the relative filename for each modification you want:
git add <filepath/filename> <filepath/filename>
- Commit your modifications with:
git commit --message "Commit message goes here"
- Put your changes online, with:
git push origin feature_name_goes_here
- Send PR—using
hub
CLI—or online (see next slides)
See first slide
- Explore github for the open-source project you want to contribute to
- Add a new issue to https://github.com/offscale/offscale-presentations specifying which project you're working on
- Contribute ;)
- Get free stuff: https://github.com/AchoArnold/discount-for-student-dev
- Continue contributing
- Profit
This slide-deck: https://offscale.io/cse-07-19.html
github.com/SamuelMarks github.com/offscale [email protected] /in/samuelmarks