Skip to content

Commit 0520817

Browse files
committed
Merge branch 'master' into docs-fixes
2 parents c8cb507 + 485f3ba commit 0520817

File tree

1,024 files changed

+47168
-17764
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,024 files changed

+47168
-17764
lines changed

.editorconfig

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,37 @@
11
[*]
2-
charset=utf-8
3-
end_of_line=lf
4-
insert_final_newline=true
5-
indent_style=space
6-
indent_size=4
7-
max_line_length=120
2+
charset = utf-8
3+
end_of_line = lf
4+
insert_final_newline = true
5+
indent_style = space
6+
indent_size = 4
7+
max_line_length = 120
88

99
[*.json]
10-
indent_size=2
10+
indent_size = 2
1111

12-
[*.yaml]
13-
indent_size=2
12+
[{*.yaml,*.yml}]
13+
indent_size = 2
1414

1515
[*.ipynb]
16-
insert_final_newline=false
16+
insert_final_newline = false
17+
18+
[*.{kt,kts}]
19+
ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL
20+
21+
# Disable wildcard imports entirely
22+
ij_kotlin_name_count_to_use_star_import = 2147483647
23+
ij_kotlin_name_count_to_use_star_import_for_members = 2147483647
24+
ij_kotlin_packages_to_use_import_on_demand = unset
25+
26+
ktlint_code_style = ktlint_official
27+
ktlint_experimental = enabled
28+
ktlint_standard_filename = disabled
29+
ktlint_standard_no-empty-first-line-in-class-body = disabled
30+
ktlint_class_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than = 4
31+
ktlint_function_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than = 4
32+
ktlint_standard_chain-method-continuation = disabled
33+
ktlint_ignore_back_ticked_identifier = true
34+
ktlint_standard_multiline-expression-wrapping = disabled
35+
36+
[{*/build/**/*,**/*keywords*/**,**/*.Generated.kt,**/*$Extensions.kt}]
37+
ktlint = disabled
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Auto-commit generated code
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v3
15+
16+
- name: Set up JDK 11
17+
uses: actions/setup-java@v4
18+
with:
19+
distribution: 'temurin'
20+
java-version: '11'
21+
22+
- name: Run Gradle task
23+
run: ./gradlew :core:processKDocsMain
24+
25+
- name: Commit changes
26+
run: |
27+
git config --global user.name 'github-actions[bot]'
28+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
29+
git add ./core/generated-sources
30+
git diff --staged --quiet || git commit -m "Automated commit of generated code"
31+
git push
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Show generated code in PR
2+
3+
on:
4+
pull_request:
5+
types:
6+
- edited
7+
- opened
8+
- synchronize
9+
- converted_to_draft
10+
- ready_for_review
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
steps:
18+
- name: Cancel Previous Runs
19+
uses: styfle/[email protected]
20+
with:
21+
access_token: ${{ github.token }}
22+
23+
- name: Checkout repository
24+
uses: actions/checkout@v3
25+
26+
- name: Set up JDK 11
27+
uses: actions/setup-java@v4
28+
with:
29+
distribution: 'temurin'
30+
java-version: '11'
31+
32+
- name: Configure Git User
33+
run: |
34+
git config --global user.email "[email protected]"
35+
git config --global user.name "GitHub Actions"
36+
37+
- name: Run Gradle task
38+
run: ./gradlew :core:processKDocsMain
39+
40+
- name: Check for changes in generated sources
41+
id: git-diff
42+
run: echo "::set-output name=changed::$(if git diff --quiet './core/generated-sources'; then echo 'false'; else echo 'true'; fi)"
43+
44+
- name: Commit and push if changes
45+
id: git-commit
46+
if: steps.git-diff.outputs.changed == 'true'
47+
run: |
48+
git checkout -b generated-sources/docs-update-${{ github.run_number }}
49+
git add './core/generated-sources'
50+
git commit -m "Update generated sources with recent changes"
51+
git push origin generated-sources/docs-update-${{ github.run_number }}
52+
echo "::set-output name=commit::$(git rev-parse HEAD)"
53+
54+
- name: Remove old comments
55+
uses: actions/github-script@v5
56+
if: steps.git-diff.outputs.changed == 'true'
57+
with:
58+
# language=js
59+
script: |
60+
const issue_number = context.issue.number;
61+
const {owner, repo} = context.repo;
62+
63+
const comments = await github.rest.issues.listComments({
64+
issue_number,
65+
owner,
66+
repo,
67+
});
68+
69+
const botComments = comments.data.filter(
70+
(comment) => comment.user.login === 'github-actions[bot]'
71+
);
72+
73+
for (const comment of botComments) {
74+
await github.rest.issues.deleteComment({
75+
comment_id: comment.id,
76+
owner,
77+
repo,
78+
});
79+
}
80+
81+
- name: Add comment to PR
82+
uses: actions/github-script@v5
83+
if: steps.git-diff.outputs.changed == 'true'
84+
with:
85+
# language=js
86+
script: |
87+
github.rest.issues.createComment({
88+
issue_number: context.issue.number,
89+
owner: context.repo.owner,
90+
repo: context.repo.repo,
91+
body: "Generated sources will be updated after merging this PR.\nPlease inspect the changes in [here](https://github.com/${{ github.repository }}/commit/${{ steps.git-commit.outputs.commit }}).",
92+
});

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ jobs:
3333
apt-get update
3434
apt-get install -y zip
3535
mkdir -p artifacts
36-
- name: Build docs and include sitemap.xml
36+
- name: Build docs # and include sitemap.xml TODO: uncomment when sitemap.xml is available
3737
run: |
3838
export DISPLAY=:99
3939
Xvfb :99 &
4040
/opt/builder/bin/idea.sh helpbuilderinspect -source-dir . -product $PRODUCT --runner github -output-dir artifacts/ || true
4141
test -e artifacts/$ARTIFACT && echo $ARTIFACT exists
42-
cp docs/StardustDocs/sitemap.xml artifacts/sitemap.xml
43-
cd artifacts
44-
zip -r $ARTIFACT sitemap.xml
42+
# cp docs/StardustDocs/sitemap.xml artifacts/sitemap.xml
43+
# cd artifacts
44+
# zip -r $ARTIFACT sitemap.xml
4545
working-directory: ${{ github.workspace }}
4646
- name: Upload modified documentation artifact
4747
uses: actions/upload-artifact@v3

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Default ignored files
22
.idea
33
.gradle
4+
.kotlin
45
build
56
.ipynb_checkpoints

CONTRIBUTING.md

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ so do familiarize yourself with the following guidelines.
3333
* PR should be linked with the issue,
3434
excluding minor documentation changes, adding unit tests, and fixing typos.
3535
* If you make any code changes:
36-
* Follow the [Kotlin Coding Conventions](https://kotlinlang.org/docs/reference/coding-conventions.html).
36+
* Follow the [Kotlin Coding Conventions](https://kotlinlang.org/docs/reference/coding-conventions.html).
37+
[Ktlint](https://pinterest.github.io/ktlint/latest/) can help here.
3738
* [Build the project](#building) to ensure it all works and passes the tests.
3839
* If you fix a bug:
3940
* Write the test that reproduces the bug.
@@ -51,18 +52,21 @@ so do familiarize yourself with the following guidelines.
5152

5253
## PR workflow
5354

54-
0. The contributor builds the library locally and runs all unit tests via the Gradle task `dataframe:test`
55-
(see the ["Building"](#building) chapter).
55+
0. The contributor builds the library locally and runs all unit tests via the Gradle task
56+
`dataframe:test -Pkotlin.dataframe.debug=true` (see the ["Building"](#building) chapter).
5657
1. The contributor submits the PR if the local build is successful and the tests are green.
57-
2. The reviewer put his name in the "Reviewers" section of the proposed PR at the start of the review process.
58-
3. The reviewer leaves the comments or marks the PR with the abbreviation "LGTM" (Looks good to me).
58+
2. The reviewer puts their name in the "Reviewers" section of the proposed PR at the start of the review process.
59+
3. The reviewer leaves comments or marks the PR with the abbreviation "LGTM" (Looks good to me).
5960
4. The contributor answers the comments or fixes the proposed PR.
6061
5. The reviewer marks the PR with the word "LGTM."
61-
6. The maintainer could suggest merging the master branch to the PR branch a few times due to changes in the `master` branch.
62-
7. The maintainer runs TC builds (unit tests and examples as integration tests).
63-
8. TC writes the result (passed or not passed) to the PR checks at the bottom of the proposed PR.
64-
9. If it is possible, maintainers share the details of the failed build with the contributor.
65-
10. Maintainer merges the PR if all checks are successful and there is no conflict with the master branch.
62+
6. The maintainer could suggest merging the `master` branch to the PR branch a few times due to changes in the `master` branch.
63+
7. If the PR influences generated code/samples, a bot will inform about this in the PR comments.
64+
8. The maintainer runs TeamCity builds (unit tests and examples as integration tests).
65+
9. TeamCity writes the result (passed or not passed) to the PR checks at the bottom of the proposed PR.
66+
10. If it is possible, maintainers share the details of the failed build with the contributor.
67+
11. The maintainer merges the PR if all checks are successful and there is no conflict with the `master` branch.
68+
12. The maintainer closes the PR and the issue linked to it.
69+
13. If the PR influences generated code, a bot will auto-commit the newly generated code into the `master` branch.
6670

6771
## How to fix an existing issue
6872

@@ -81,15 +85,28 @@ so do familiarize yourself with the following guidelines.
8185

8286
## Environment requirements
8387

84-
JDK >= 11 referred to by the `JAVA_HOME` environment variable.
88+
* JDK >= 11 referred to by the `JAVA_HOME` environment variable.
89+
90+
* Note, any version above 11 should work in theory, but JDK 11 is the only version we test with,
91+
so it is the recommended version.
92+
93+
* We recommend using [IntelliJ IDEA](https://www.jetbrains.com/idea/download/) as the IDE. This
94+
has the best support for Kotlin, compiler plugins, Gradle, and [Kotlin Notebook](https://kotlinlang.org/docs/kotlin-notebook-overview.html) of course.
95+
96+
* We recommend using the [Ktlint plugin](https://plugins.jetbrains.com/plugin/15057-ktlint) for [IntelliJ IDEA](https://www.jetbrains.com/idea/download/).
97+
It is able to read the `.editorconfig` file and apply the same formatting rules as [Ktlint](https://pinterest.github.io/ktlint/latest/) in the CI.
98+
99+
* Check out the [KDoc Preprocessor guide](KDOC_PREPROCESSING.md) to understand how to work with the KDoc preprocessor.
85100

86101
## Building
87102

88103
This library is built with Gradle.
89104

90-
* Run `./gradlew build` to build. It also runs all the tests.
105+
* Run `./gradlew build` to build. It also runs all the tests and checks the linter.
91106
* Run `./gradlew <module>:test` to test the module you are looking at to speed
92107
things up during development.
108+
* Make sure to pass the extra parameter `-Pkotlin.dataframe.debug=true` to enable debug mode. This flag will
109+
make sure some extra checks are run, which are important but too heavy for production.
93110

94111
You can import this project into IDEA, but you have to delegate the build actions
95112
to Gradle (in Preferences -> Build, Execution, Deployment -> Build Tools -> Gradle -> Runner)

0 commit comments

Comments
 (0)