Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
Modify README.md, CONTRIBUTING_DCO.md and add settings.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
kirilraykov committed Nov 7, 2022
1 parent c425230 commit 41eac38
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 34 deletions.
41 changes: 12 additions & 29 deletions CONTRIBUTING_DCO.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Contributing to date-and-time-pattern-detection

_NOTE: This is a template document that requires editing before it is ready to use!_

We welcome contributions from the community and first want to thank you for taking the time to contribute!

Please familiarize yourself with the [Code of Conduct](https://github.com/vmware/.github/blob/main/CODE_OF_CONDUCT.md) before contributing.
Expand All @@ -22,23 +20,18 @@ We welcome many different types of contributions and not all of them need a Pull

## Getting started

_TO BE EDITED: This section explains how to build the project from source, including Development Environment Setup, Build, Run and Test._

_Provide information about how someone can find your project, get set up, build the code, test it, and submit a pull request successfully without having to ask any questions. Also include common errors people run into, or useful scripts they should run._

_List any tests that the contributor should run / or testing processes to follow before submitting. Describe any automated and manual checks performed by reviewers._

* Please familiarize with how to build and run the project from README.md file.

## Contribution Flow

This is a rough outline of what a contributor's workflow looks like:

* Make a fork of the repository within your GitHub account
* Create a topic branch in your fork from where you want to base your work
* Make commits of logical units
* Make sure your commit messages are with the proper format, quality and descriptiveness (see below)
* Push your changes to the topic branch in your fork
* Create a pull request containing that commit
1. Make a fork of the repository within your GitHub account
2. Create a topic branch in your fork from where you want to base your work
3. Make commits of logical units
4. Make sure your commit messages are with the proper format, quality and descriptiveness (see below)
5. Push your changes to the topic branch in your fork
6. Create a pull request containing that commit

We follow the GitHub workflow and you can find more details on the [GitHub flow documentation](https://docs.github.com/en/get-started/quickstart/github-flow).

Expand All @@ -47,28 +40,18 @@ We follow the GitHub workflow and you can find more details on the [GitHub flow
Before submitting your pull request, we advise you to use the following:

1. Check if your code changes will pass both code linting checks and unit tests.
2. Ensure your commit messages are descriptive. We follow the conventions on [How to Write a Git Commit Message](http://chris.beams.io/posts/git-commit/). Be sure to include any related GitHub issue references in the commit message. See [GFM syntax](https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown) for referencing issues and commits.
3. Check the commits and commits messages and ensure they are free from typos.
2. Check if your changes only cover the feature being proposed - verify that no other parts of the code were updated unintentionally.
3. If the changes were done on the Rest-api-service module, please execute all Service Integration Tests.
4. Ensure your commit messages are descriptive. We follow the conventions on [How to Write a Git Commit Message](http://chris.beams.io/posts/git-commit/). Be sure to include any related GitHub issue references in the commit message. See [GFM syntax](https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown) for referencing issues and commits.
5. Check the commits and commits messages and ensure they are free from typos.

## Reporting Bugs and Creating Issues

For specifics on what to include in your report, please follow the guidelines in the issue and pull request templates when available.

_TO BE EDITED: Add additional information if needed._


## Ask for Help

_TO BE EDITED: Provide information about the channels you use to communicate (i.e. Slack, IRC, Discord, etc)_

The best way to reach us with a question when contributing is to ask on:

* The original GitHub issue
* The developer mailing list
* Our Slack channel


## Additional Resources

_Optional_

* The developer mailing list
40 changes: 35 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,22 @@ validate the localized date/time components. It provides suggestions based on th
* Maven
* Docker (optional, depending on the build type)

## Build and Run as local REST-API service
## Build and Run as local REST-API service using Docker

1. Clone from remote to local machine
2. Pull Docker image from Artifactory
3. Run on specified port
1. Pull Docker image from GitHub Container Registry: `docker pull ghcr.io/vmware-labs/date-and-time-pattern-detection:main`
2. Run on specified port. Example: `docker run -p 8083:8083 ghcr.io/vmware-labs/date-and-time-pattern-detection:main`
3. Open browser at http://localhost:8083/i18n/swagger-ui/index.html#/ (Port may be different, depending on above step).
4. Access the REST-API documentation and test-out the endpoints.

**Note: You can also run the service locally by cloning the project, calling `mvn clean install` and running the Jar file under rest-api-service/target/.**

### Example Usage

You can either validate localized input containing Dates, times and more temporal types, get CLDR standard patterns or
convert localized input from 1 language to another. Sample request for input validation:

```
curl -X POST "http://localhost:8083/validate/localizedInput/en-US" -H "accept: */*" -H "Content-Type: application/json" -d "Monday, 25 July, 2022 at 8:14 in the morning"
curl -X POST "http://localhost:8083/i18n/validate/localizedInput/en-US" -H "accept: */*" -H "Content-Type: application/json" -d "Monday, 25 July, 2022 at 8:14 in the morning"
```

Sample response for input validation:
Expand All @@ -45,6 +48,33 @@ Sample response for input validation:
}
```

## Using the project as Maven Dependency
You can directly use the library part of the project by injecting the dependency in your project.
1. Add the dependency in your Maven pom.xml file:
```
<dependency>
<groupId>com.vmware.g11n</groupId>
<artifactId>date-time-pattern-detection-library</artifactId>
<version>0.0.6</version>
</dependency>
```
2. Specify GitHub Package Registry as Maven Repository in your local settings.xml:
```
<repositories>
<repository>
<id>github</id>
<name>GitHub VMware Apache Maven Packages</name>
<url>https://maven.pkg.github.com/vmware-labs/date-and-time-pattern-detection</url>
</repository>
</repositories>
```
3. Run `mvn clean install` to inject the dependencies
4. Access all functionality by initializing Pattern Detection object:
```
DateTimePatternDetection patternDetection = new DateTimePatternDetection();
ValidationResult validationResult = patternDetection.validateLocalizedInput("2016년 9월 1일 목요일 AM 11시 7분 10초 그리니치 표준시", "ko-KR");
```
As the project is multi-module, you can only use the service models for mapping response objects from the Rest-API service (may be useful for using the project in test frameworks).
## Contributing

The date-and-time-pattern-detection project team welcomes contributions from the community. Before you start working with date-and-time-pattern-detection, please
Expand Down
29 changes: 29 additions & 0 deletions settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8" ?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>

<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>github</id>
<name>GitHub VMware Apache Maven Packages</name>
<url>https://maven.pkg.github.com/vmware-labs/date-and-time-pattern-detection</url>
</repository>
</repositories>
</profile>
</profiles>

<servers>
<server>
<id>github</id>
<username>${env.GITHUB_USERNAME}</username>
<password>${env.GITHUB_TOKEN}</password>
</server>
</servers>
</settings>

0 comments on commit 41eac38

Please sign in to comment.