diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..0e2a5007 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,14 @@ + + +### Summary + + + +### Checklist + +* [ ] Does your PR title have the correct [title format](https://github.com/amplitude/Amplitude-Kotlin/blob/main/CONTRIBUTING.md#pr-commit-title-conventions)? +* Does your PR have a breaking change?: \ No newline at end of file diff --git a/.github/workflows/jira-issue-create.yml b/.github/workflows/jira-issue-create.yml new file mode 100644 index 00000000..361fe013 --- /dev/null +++ b/.github/workflows/jira-issue-create.yml @@ -0,0 +1,39 @@ +# Creates jira tickets for new github issues to help triage +name: Jira Issue Creator + +on: + issues: + types: [opened] + +jobs: + build: + runs-on: ubuntu-18.04 + environment: Jira + name: SDK Bot Jira Issue Creation + steps: + - name: Login + uses: atlassian/gajira-login@master + env: + JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} + JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} + JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} + + - name: Create issue + id: create + uses: atlassian/gajira-create@master + with: + project: ${{ secrets.JIRA_PROJECT }} + issuetype: Task + summary: | + [SDK - Kotlin] ${{ github.event.issue.title }} + description: | + ${{ github.event.issue.html_url }} + fields: '{ + "customfield_10006": 1391, + "customfield_11481": {"value": "Governance 🕵️"}, + "customfield_11200": {"value": "Developer Experience"}, + "labels": ["kotlin"] + }' # sprint, pillar, pod, labels + + - name: Log created issue + run: echo "Issue AMP-${{ steps.create.outputs.issue }} was created" diff --git a/.github/workflows/semantic-pr.yml b/.github/workflows/semantic-pr.yml new file mode 100644 index 00000000..fe910b10 --- /dev/null +++ b/.github/workflows/semantic-pr.yml @@ -0,0 +1,43 @@ +name: Semantic PR Check + +on: + pull_request: + types: [opened, synchronize, edited] + +jobs: + pr-title-check: + name: Check PR for semantic title + runs-on: ubuntu-18.04 + steps: + - name: PR title is valid + if: > + startsWith(github.event.pull_request.title, 'feat:') || startsWith(github.event.pull_request.title, 'feat(') || + startsWith(github.event.pull_request.title, 'fix:') || startsWith(github.event.pull_request.title, 'fix(') || + startsWith(github.event.pull_request.title, 'perf:') || startsWith(github.event.pull_request.title, 'perf(') || + startsWith(github.event.pull_request.title, 'docs:') || startsWith(github.event.pull_request.title, 'docs(') || + startsWith(github.event.pull_request.title, 'test:') || startsWith(github.event.pull_request.title, 'test(') || + startsWith(github.event.pull_request.title, 'refactor:') || startsWith(github.event.pull_request.title, 'refactor(') || + startsWith(github.event.pull_request.title, 'style:') || startsWith(github.event.pull_request.title, 'style(') || + startsWith(github.event.pull_request.title, 'build:') || startsWith(github.event.pull_request.title, 'build(') || + startsWith(github.event.pull_request.title, 'ci:') || startsWith(github.event.pull_request.title, 'ci(') || + startsWith(github.event.pull_request.title, 'chore:') || startsWith(github.event.pull_request.title, 'chore(') || + startsWith(github.event.pull_request.title, 'revert:') || startsWith(github.event.pull_request.title, 'revert(') + run: | + echo 'Title checks passed' + + - name: PR title is invalid + if: > + !startsWith(github.event.pull_request.title, 'feat:') && !startsWith(github.event.pull_request.title, 'feat(') && + !startsWith(github.event.pull_request.title, 'fix:') && !startsWith(github.event.pull_request.title, 'fix(') && + !startsWith(github.event.pull_request.title, 'perf:') && !startsWith(github.event.pull_request.title, 'perf(') && + !startsWith(github.event.pull_request.title, 'docs:') && !startsWith(github.event.pull_request.title, 'docs(') && + !startsWith(github.event.pull_request.title, 'test:') && !startsWith(github.event.pull_request.title, 'test(') && + !startsWith(github.event.pull_request.title, 'refactor:') && !startsWith(github.event.pull_request.title, 'refactor(') && + !startsWith(github.event.pull_request.title, 'style:') && !startsWith(github.event.pull_request.title, 'style(') && + !startsWith(github.event.pull_request.title, 'build:') && !startsWith(github.event.pull_request.title, 'build(') && + !startsWith(github.event.pull_request.title, 'ci:') && !startsWith(github.event.pull_request.title, 'ci(') && + !startsWith(github.event.pull_request.title, 'chore:') && !startsWith(github.event.pull_request.title, 'chore(') && + !startsWith(github.event.pull_request.title, 'revert:') && !startsWith(github.event.pull_request.title, 'revert(') + run: | + echo 'Pull request title is not valid. Please check github.com/amplitude/Amplitude-Java/blob/main/CONTRIBUTING.md#pr-commit-title-conventions' + exit 1 diff --git a/.gitignore b/.gitignore index 56cc6425..675cd034 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ captures/ # IntelliJ *.iml +.idea .idea/workspace.xml .idea/tasks.xml .idea/gradle.xml @@ -83,3 +84,5 @@ lint/generated/ lint/outputs/ lint/tmp/ # lint/reports/ + +.DS_Store \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..e08012c9 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,17 @@ +### PR Commit Title Conventions + +PR titles should follow [conventional commit standards](https://www.conventionalcommits.org/en/v1.0.0/). + +#### Commit Types + +- `feat()`: New features (minimum minor release) +- `fix()`: Bug fixes (minimum patch release) +- `perf()`: Performance improvement +- `docs()`: Documentation updates +- `test()`: Test updates +- `refactor()`: Code change that neither fixes a bug nor adds a feature +- `style()`: Code style changes (e.g. formatting, commas, semi-colons) +- `build()`: Changes that affect the build system or external dependencies (e.g. Yarn, Npm) +- `ci()`: Changes to our CI configuration files and scripts +- `chore()`: Other changes that don't modify src or test files +- `revert()`: Revert commit