Skip to content

Commit d7066d1

Browse files
author
Nisha K
committed
Added initial contributing documentation
- Added a CODE_OF_CONDUCT.md - Modified CONTRIBUTING.md with more details - Modified the README.md to reference the new information Signed-off-by: Nisha K <[email protected]>
1 parent abe1a24 commit d7066d1

File tree

3 files changed

+195
-28
lines changed

3 files changed

+195
-28
lines changed

CODE_OF_CONDUCT.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, gender identity and expression, level of experience,
9+
education, socio-economic status, nationality, personal appearance, race,
10+
religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by sending an email to [email protected] and/or [email protected]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+

CONTRIBUTING.md

Lines changed: 95 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,104 @@
1-
### Give me your bugs, your docs, your pull requests...
1+
### Contributing to the Tern project
22

3-
But before you do, please take a moment to read the code of conduct
3+
Once again, we hope you have read our [code of conduct](/CODE_OF_CONDUCT.md) before starting.
44

5-
### How to file a bug
5+
We are excited to be working with the community to help with Open Source compliance obligations!
66

7-
### How to submit new or corrected documentation
7+
You can contribute in the following ways:
88

9-
### How to submit a pull request
9+
* Improving the Documentation
10+
* Adding to the Command Library
11+
* Improving the Unit and Functional Tests
12+
* Improving the Core Project
1013

11-
### Adding to the Command Library
14+
### Skills for contributing
1215

13-
Link to command library wiki
16+
* English (not necessarily fluent but workable)
17+
* Python (a working knowledge of object oriented Python would be nice, but if you know how python functions/modules work, this is enough to get you started)
18+
* YAML (Tern uses yaml files heavily for data lookup. An overview of YAML can be found [here](http://yaml.org/)
1419

15-
### Talk to me!
20+
### Keeping in touch
1621

17-
### Glossary
22+
If you would like to ask a question or start a discussion with the maintainers, post a topic on the [public forum](https://groups.google.com/forum/#!forum/tern-maintainers). No registration is required. We will respond to your question or topic within three days unless the post was over the weekend in which case we may take longer to respond. This is our primary communication channel so it is highly likely that you will get a response here.
1823

24+
If you would like to chat live, you can join the [slack channel](https://vmwarecode.slack.com/messages/tern). If you don't have an @vmware.com or @emc.com email, please sign up at https://code.vmware.com/slack to get a Slack invite. Although we monitor the channel, we may not respond right away and if the same question was asked on the forum, we will choose to respond there.
25+
26+
### An overview of the contribution lifecycle
27+
28+
Once you decide that you would like to play around with the project
29+
30+
1. Fork the git repository to your personal github account. See [here](https://help.github.com/articles/fork-a-repo/#fork-an-example-repository) and [here](https://help.github.com/articles/fork-a-repo/#keep-your-fork-synced) to get you started.
31+
2. Create a branch for your work
32+
```
33+
$ git checkout -b my-work
34+
```
35+
3. Work on the code
36+
4. Update your branch with the latest from upstream. See [here](https://help.github.com/articles/syncing-a-fork/) for an example. Note that if you have not worked on the master branch of your fork, the merges should be fast-forward merges and you should not be resolving conflicts.
37+
5. Replay your work on top of the latest
38+
```
39+
$ git checkout my-work
40+
$ git rebase master
41+
```
42+
Expect to spend time resolving conflicts here.
43+
6. Run functional tests.
44+
6. Push your branch changes to a remote branch in your fork of the repo
45+
7. Submit a pull request (PR for short) to the upstream repo. See [here](https://help.github.com/articles/creating-a-pull-request-from-a-fork/) to get you started. If all goes well, there should be no conflicts.
46+
8. A reviewer will further communicate with you through the PR.
47+
9. If everything looks good the PR will be accepted.
48+
49+
### Commit message format
50+
51+
The commit message of your PR should be able to communicate what problem/opportunity the PR addresses without any reference to forum messages or discussions on slack or IRL. You may make a reference to a github issue number using the github format (eg: Resolves: #1). Here is a summary taken from [this blog](https://chris.beams.io/posts/git-commit/)
52+
53+
* Separate subject from body with a blank line
54+
* Limit the subject line to 50 characters
55+
* Capitalize the subject line
56+
* Do not end the subject line with a period
57+
* Use the imperative mood in the subject line
58+
* Wrap the body at 72 characters
59+
* Use the body to explain what and why vs. how
60+
```
61+
Summarize changes in around 50 characters or less
62+
63+
More detailed explanatory text, if necessary. Wrap it to about 72
64+
characters or so. In some contexts, the first line is treated as the
65+
subject of the commit and the rest of the text as the body. The
66+
blank line separating the summary from the body is critical (unless
67+
you omit the body entirely); various tools like `log`, `shortlog`
68+
and `rebase` can get confused if you run the two together.
69+
70+
Explain the problem that this commit is solving. Focus on why you
71+
are making this change as opposed to how (the code explains that).
72+
Are there side effects or other unintuitive consequences of this
73+
change? Here's the place to explain them.
74+
75+
Further paragraphs come after blank lines.
76+
77+
- Bullet points are okay, too
78+
79+
- Typically a hyphen or asterisk is used for the bullet, preceded
80+
by a single space, with blank lines in between, but conventions
81+
vary here
82+
83+
If you use an issue tracker, put references to them at the bottom,
84+
like this:
85+
86+
Resolves: #123
87+
See also: #456, #789
88+
```
89+
### Filing an Issue
90+
91+
You may file an issue through the github issue tracker. Please follow the same guidelines as the commit message guidelines when formatting your issue. Please make sure to include the following for quick debugging and resolution:
92+
93+
* The SHA256 commit at which the bug occured
94+
* The project release version
95+
* Your dev environment
96+
* Reproduction steps
97+
* The contents of tern.log (which may not have everything that went to stdout so the contents of that would also be helpful if it is different)
98+
99+
You may file an issue and create a pull request that references said issue. This, however, does not guarantee acceptance of the PR. Contributing in this way works for small bug or documentation fixes but doesn't lend itself well to large updates. We encourage you to start a discussion on the forum. Typically a follow up issue will be created referencing the topic.
100+
101+
### Troubleshooting
102+
103+
* Tern produces a generic message about being unable to execute a docker command with a CalledProcessError from the get go: Make sure the docker daemon is running first
104+
* Unable to find module 'yaml': make sure to activate the python virtualenv first and then run pip install -r requirements.txt

README.md

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,53 @@
1-
### What is Tern?
1+
### Welcome to the Tern Project
22

33
Tern is a tool to find the metadata for packages installed in Docker containers, specifically the sources, versions and licenses. It does this by looking up
4-
a "command library" for code snippets to execute in a running container. The command library is a list of shell commands used to install and remove packages
5-
with associated shell commands to run within the container to retrieve specific information.
4+
a "command library" for code snippets to execute in a running container. The command library is a list of commands used to install and remove packages
5+
(such as a package manager) with associated shell commands to run within the container to retrieve specific information.
66

7-
Tern was created to address the issue that Docker containers where distributed without certainity of what packages they contained. This becomes especially problematic when distributing packages with incompatible licenses or licenses that have restrictions on distribution.
7+
Tern was created to help developers meet open source compliance requirements for containers. Tools like Docker make it easy to build and distribute containers but keeping track of what is installed is left to developer or devops teams. Tern aims to bridge this gap.
88

9-
### Requirements
9+
### Try it out
10+
11+
#### Requirements
1012
- Git (Installation instructions can be found here: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
1113
- Docker CE (Installation instructions can be found here: https://docs.docker.com/engine/installation/#server)
1214
- Python 3.6.2 (sudo apt-get install python3.6 or sudo dnf install python36)
1315

14-
### Getting Started
15-
Once you have installed the requirements you can run these commands in a terminal to get you started:
16+
Make sure the docker daemon is running. If it is you can run these commands to get you started:
1617
```
1718
$ python3 -m venv ternenv
1819
$ cd ternenv
19-
$ git clone git@gitlab.eng.vmware.com:opensource/tern.git
20+
$ git clone git@github.com:vmware/tern.git
2021
$ source bin/activate
2122
$ cd tern
2223
$ pip install -r requirements.txt
23-
$ ./tern report -d samples/debian_vim/Dockerfile
24+
$ ./tern report -d samples/photon_git/Dockerfile
2425
```
25-
If you come across any issues, please file a bug with the complete output. If it completes successfully, take a look at report.txt. You can file bugs against the report as well
26+
Take a look at report.txt to see what packages are installed in the created Docker image and how Tern got this information. Feel free to try this out on the other sample Dockerfiles in the samples directory or on Dockerfiles you may be working with.
2627

27-
### Usage
28+
#### To get a summary report
2829
```
29-
$ python3 -m venv ternenv
30-
$ cd ternenv
31-
$ git clone [email protected]:opensource/tern.git
32-
$ source bin/activate
33-
$ cd tern
34-
$ pip install -r requirements.txt
35-
$ ./tern -h
30+
$ ./tern report -s -d samples/photon_git_Dockerfile
3631
```
32+
WARNING: Tern is meant to give guidance on what may be installed for each line in a Dockerfile so it is recommended that for the purpose of investigation, the default report is used. The summary report may be used as the output of a build artifact or something to submit to a compliance or legal team.
3733

38-
### To run a test
34+
#### To run a test
3935
```
4036
$ cd ternenv
4137
$ source bin/activate
4238
$ git clone [email protected]:opensource/tern.git
4339
$ cd tern
4440
$ export PYTHONPATH=`pwd`
4541
$ python tests/<test file>.py
42+
4643
```
44+
### Documentation
45+
Architecture, function blocks and code descriptions are located on the Wiki. Feel free to use it as a guide to usage and development. We also welcome contributions to the documentation. See the [contributing guide](/CONTRIBUTING.md) to find out how to submit changes.
46+
47+
### Get Involved
48+
49+
Do you have questions about Tern? Do you think it can do better? Would you like to make it better? You can get involved by giving your feedback and contributing to the code, documentation and conversation!
50+
51+
Please read our [code of conduct](/CODE_OF_CONDUCT.md) first.
52+
53+
Next, take a look at the [contributing guide](/CONTRIBUTING.md) to find out how you can start.

0 commit comments

Comments
 (0)