Skip to content

Commit 584584f

Browse files
feat: Init repo
1 parent 8db1e24 commit 584584f

25 files changed

+3485
-1
lines changed

CODE_OF_CONDUCT.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# 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
9+
experience, education, socio-economic status, nationality, personal appearance,
10+
race, 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 reject
41+
comments, commits, code, wiki edits, issues, and other contributions that are
42+
not aligned to this Code of Conduct, or to ban temporarily or permanently any
43+
contributor for other behaviors that they deem inappropriate, threatening,
44+
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+
This Code of Conduct also applies outside the project spaces when the Project
56+
Steward has a reasonable belief that an individual's behavior may have a
57+
negative impact on the project or its community.
58+
59+
## Conflict Resolution
60+
61+
We do not believe that all conflict is bad; healthy debate and disagreement
62+
often yield positive results. However, it is never okay to be disrespectful or
63+
to engage in behavior that violates the project’s code of conduct.
64+
65+
If you see someone violating the code of conduct, you are encouraged to address
66+
the behavior directly with those involved. Many issues can be resolved quickly
67+
and easily, and this gives people more control over the outcome of their
68+
dispute. If you are unable to resolve the matter for any reason, or if the
69+
behavior is threatening or harassing, report it. We are dedicated to providing
70+
an environment where participants feel welcome and safe.
71+
72+
Reports should be directed to *[PROJECT STEWARD NAME(s) AND EMAIL(s)]*, the
73+
Project Steward(s) for *[PROJECT NAME]*. It is the Project Steward’s duty to
74+
receive and address reported violations of the code of conduct. They will then
75+
work with a committee consisting of representatives from the Open Source
76+
Programs Office and the Google Open Source Strategy team. If for any reason you
77+
are uncomfortable reaching out the Project Steward, please email
78+
79+
80+
We will investigate every complaint, but you may not receive a direct response.
81+
We will use our discretion in determining when and how to follow up on reported
82+
incidents, which may range from not taking action to permanent expulsion from
83+
the project and project-sponsored spaces. We will notify the accused of the
84+
report and provide them an opportunity to discuss it before any action is taken.
85+
The identity of the reporter will be omitted from the details of the report
86+
supplied to the accused. In potentially harmful situations, such as ongoing
87+
harassment or threats to anyone's safety, we may take action without notice.
88+
89+
## Attribution
90+
91+
This Code of Conduct is adapted from the Contributor Covenant, version 1.4,
92+
available at
93+
https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

CONTRIBUTING.md

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# How to Contribute
2+
3+
We'd love to accept your patches and contributions to this project. There are
4+
just a few small guidelines you need to follow.
5+
6+
## Contributor License Agreement
7+
8+
Contributions to this project must be accompanied by a Contributor License
9+
Agreement. You (or your employer) retain the copyright to your contribution;
10+
this simply gives us permission to use and redistribute your contributions as
11+
part of the project. Head over to <https://cla.developers.google.com/> to see
12+
your current agreements on file or to sign a new one.
13+
14+
You generally only need to submit a CLA once, so if you've already submitted one
15+
(even if it was for a different project), you probably don't need to do it
16+
again.
17+
18+
## Code reviews
19+
20+
All submissions, including submissions by project members, require review. We
21+
use GitHub pull requests for this purpose. Consult
22+
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
23+
information on using pull requests.
24+
25+
## Community Guidelines
26+
27+
This project follows
28+
[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/).
29+
30+
## Building the project
31+
32+
To build, package, and run all unit tests run the command
33+
34+
```
35+
mvn clean verify
36+
```
37+
38+
### Running Integration tests
39+
40+
To include integration tests when building the project, you need access to
41+
a GCP Project with a valid service account.
42+
43+
For instructions on how to generate a service account and corresponding
44+
credentials JSON see: [Creating a Service Account][1].
45+
46+
Then run the following to build, package, run all unit tests and run all
47+
integration tests.
48+
49+
```bash
50+
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json
51+
mvn -Penable-integration-tests clean verify
52+
```
53+
54+
## Code Samples
55+
56+
Code Samples must be bundled in separate Maven modules, and guarded by a
57+
Maven profile with the name `enable-samples`.
58+
59+
The samples must be separate from the primary project for a few reasons:
60+
1. Primary projects have a minimum Java version of Java 7 whereas samples have
61+
a minimum Java version of Java 8. Due to this we need the ability to
62+
selectively exclude samples from a build run.
63+
2. Many code samples depend on external GCP services and need
64+
credentials to access the service.
65+
3. Code samples are not released as Maven artifacts and must be excluded from
66+
release builds.
67+
68+
### Building
69+
70+
```bash
71+
mvn -Penable-samples clean verify
72+
```
73+
74+
Some samples require access to GCP services and require a service account:
75+
76+
```bash
77+
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json
78+
mvn -Penable-samples clean verify
79+
```
80+
81+
### Profile Config
82+
83+
1. To add samples in a profile to your Maven project, add the following to your
84+
`pom.xml`
85+
86+
```xml
87+
<project>
88+
[...]
89+
<profiles>
90+
<profile>
91+
<id>enable-samples</id>
92+
<modules>
93+
<module>sample</module>
94+
</modules>
95+
</profile>
96+
</profiles>
97+
[...]
98+
</project>
99+
```
100+
101+
2. [Activate](#profile-activation) the profile.
102+
3. Define your samples in a normal Maven project in the `samples/` directory.
103+
104+
### Code Formatting
105+
106+
Code in this repo is formatted with
107+
[google-java-format](https://github.com/google/google-java-format).
108+
To run formatting on your project, you can run:
109+
```
110+
mvn com.coveo:fmt-maven-plugin:format
111+
```
112+
113+
### Profile Activation
114+
115+
To include code samples when building and testing the project, enable the
116+
`enable-samples` Maven profile.
117+
118+
#### Command line
119+
120+
To activate the Maven profile on the command line add `-Penable-samples` to your
121+
Maven command.
122+
123+
#### Maven `settings.xml`
124+
125+
To activate the Maven profile in your `~/.m2/settings.xml` add an entry of
126+
`enable-samples` following the instructions in [Active Profiles][2].
127+
128+
This method has the benefit of applying to all projects you build (and is
129+
respected by IntelliJ IDEA) and is recommended if you are going to be
130+
contributing samples to several projects.
131+
132+
#### IntelliJ IDEA
133+
134+
To activate the Maven Profile inside IntelliJ IDEA, follow the instructions in
135+
[Activate Maven profiles][3] to activate `enable-samples`.
136+
137+
[1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account
138+
[2]: https://maven.apache.org/settings.html#Active_Profiles
139+
[3]: https://www.jetbrains.com/help/idea/work-with-maven-profiles.html#activate_maven_profiles

0 commit comments

Comments
 (0)