Skip to content

Commit cec6944

Browse files
Merge branch 'master' into geo
# Conflicts: # settings.gradle.kts
2 parents 289a1fb + 064d044 commit cec6944

File tree

203 files changed

+17751
-1457
lines changed

Some content is hidden

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

203 files changed

+17751
-1457
lines changed

.github/README_GH_ACTIONS.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## GitHub Actions
2+
3+
While publishing and testing of the library is handled by [JetBrains TeamCity](https://www.jetbrains.com/teamcity/),
4+
there are some CI operations that are handled by GitHub actions instead.
5+
6+
### Publishing Docs
7+
8+
The building of the documentation website in [docs](../docs), and the publishing of it along
9+
with the search-indices is handled by the [Build Docs GH Action](./workflows/main.yml). Careful: This action replaces the entire contents
10+
of the documentation website.
11+
12+
### Gradle Wrapper Validation
13+
14+
We run the [Gradle Wrapper Validation action](https://github.com/gradle/wrapper-validation-action)
15+
using a [GitHub Action](./workflows/gradle-wrapper-validation.yml) as well.
16+
This action validates the checksums of all Gradle Wrapper JAR files present in the repository and
17+
fails if any unknown Gradle Wrapper JAR files are found.
18+
19+
### Auto-commit generated code
20+
21+
Anytime the source code changes on [master](https://github.com/Kotlin/dataframe/tree/master),
22+
this [GitHub Action](./workflows/generated-sources-master.yml) makes sure
23+
[`processKDocsMain`](../KDOC_PREPROCESSING.md),
24+
and `korro` are run. If there have been any changes in either [core/generated-sources](../core/generated-sources) or
25+
[docs/StardustDocs/snippets](../docs/StardustDocs/snippets), these are auto-committed to the branch, to keep
26+
it up to date.
27+
28+
### Show generated code in PR
29+
30+
To make sure no unexpected code is auto-committed to [master](https://github.com/Kotlin/dataframe/tree/master),
31+
this [GitHub Action](./workflows/generated-sources.yml) runs the same code-generating tasks but on a separate branch.
32+
If there are changes, it will leave a message in the PR, informing you about the changes that will be done to the master
33+
branch if this PR were merged.
Lines changed: 20 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
name: Show generated code in PR
1+
name: Preview Generated Code
2+
3+
permissions:
4+
contents: write
5+
statuses: write
26

37
on:
48
pull_request:
@@ -10,16 +14,15 @@ on:
1014
- ready_for_review
1115

1216
jobs:
13-
build:
17+
build_preview_generated_code:
18+
name: Build Preview of Generated Code
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: true
1422
runs-on: ubuntu-latest
1523
env:
1624
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1725
steps:
18-
- name: Cancel Previous Runs
19-
uses: styfle/cancel-workflow-action@0.9.1
20-
with:
21-
access_token: ${{ github.token }}
22-
2326
- name: Checkout repository
2427
uses: actions/checkout@v4
2528

@@ -39,7 +42,7 @@ jobs:
3942

4043
- name: Check for changes in generated sources
4144
id: git-diff
42-
run: echo "::set-output name=changed::$(if git diff --quiet './core/generated-sources' './docs/StardustDocs/snippets' './docs/StardustDocs/topics'; then echo 'false'; else echo 'true'; fi)"
45+
run: echo "changed=$(if git diff --quiet './core/generated-sources' './docs/StardustDocs/snippets' './docs/StardustDocs/topics'; then echo 'false'; else echo 'true'; fi)" >> $GITHUB_OUTPUT
4346

4447
- name: Commit and push if changes
4548
id: git-commit
@@ -49,44 +52,21 @@ jobs:
4952
git add './core/generated-sources' './docs/StardustDocs/snippets' './docs/StardustDocs/topics'
5053
git commit -m "Update generated sources with recent changes"
5154
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@v7
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-
}
55+
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
8056
81-
- name: Add comment to PR
57+
- name: Update status to PR
8258
uses: actions/github-script@v7
8359
if: steps.git-diff.outputs.changed == 'true'
8460
with:
8561
# language=js
8662
script: |
87-
github.rest.issues.createComment({
88-
issue_number: context.issue.number,
63+
await github.rest.repos.createCommitStatus({
8964
owner: context.repo.owner,
9065
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 }}).",
66+
sha: context.payload.pull_request.head.sha,
67+
state: "success",
68+
target_url: "https://github.com/${{ github.repository }}/commit/${{ steps.git-commit.outputs.commit }}",
69+
context: "Generated sources will change, merging this PR",
70+
description: "Check 'Details' to inspect changes ->"
9271
});
72+

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ so do familiarize yourself with the following guidelines.
6060
4. The contributor answers the comments or fixes the proposed PR.
6161
5. The reviewer marks the PR with the word "LGTM."
6262
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.
63+
7. If the PR influences generated code/samples, a bot will inform about this in the PR checks.
6464
8. The maintainer runs TeamCity builds (unit tests and examples as integration tests).
6565
9. TeamCity writes the result (passed or not passed) to the PR checks at the bottom of the proposed PR.
6666
10. If it is possible, maintainers share the details of the failed build with the contributor.

KDOC_PREPROCESSING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ This can be seen in action in the `core:processKDocsMain` and `core:changeJarTas
5858
To make sure the generated sources can be seen and reviewed on GitHub,
5959
since [PR #731](https://github.com/Kotlin/dataframe/pull/731),
6060
there's a [GitHub action](.github/workflows/generated-sources.yml) that runs the `core:processKDocsMain` task and
61-
comments the results on the PR. After a PR is merged, [another action](.github/workflows/generated-sources-master.yml)
61+
shows the results in the PR checks. After a PR is merged, [another action](.github/workflows/generated-sources-master.yml)
6262
runs on the master branch and commits the generated sources automatically.
6363
This way, the generated sources are always up to date with the latest changes in the code.
6464
This means you don't have to run and commit the generated sources yourself, though it's

core/README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
## :core
2+
3+
This is the core of the library, published as the `dataframe-core` package.
4+
It contains the DataFrame API and its implementation, as well as plenty of JUnit tests.
5+
6+
I/O operations are split off into other modules, like [:dataframe-excel](../dataframe-excel),
7+
or [:dataframe-jdbc](../dataframe-jdbc), however, this is has not happened yet for all operations
8+
(see [Issue #100](https://github.com/Kotlin/dataframe/issues/100)).
9+
10+
At the moment, these integrations are still part of the `:core` module:
11+
12+
- csv/tsv
13+
- html
14+
- json
15+
- jupyter
16+
17+
### Korro code samples
18+
19+
Code samples for the documentation website reside
20+
in [core/.../test/.../samples/api](./src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api) (for samples that depend solely on `dataframe-core`),
21+
and [tests/.../samples/api](../tests/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api) (for samples can depend on other I/O modules)
22+
and they are copied over to Markdown files in [docs/StardustDocs/topics](../docs/StardustDocs/topics)
23+
by [Korro](https://github.com/devcrocod/korro).
24+
25+
### Explainer dataframes
26+
27+
Aside from code samples, `@TransformDataFrameExpressions` annotated test functions also generate sample
28+
dataframe HTML files that can be used as iFrames on the documentation website.
29+
They are tested, generated, and copied over to [docs/StardustDocs/snippets](../docs/StardustDocs/snippets) by
30+
our "explainer" [plugin callback proxy](./src/test/kotlin/org/jetbrains/kotlinx/dataframe/explainer),
31+
which hooks into [the TestBase class](./src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api/TestBase.kt) and
32+
retrieves the intermediate DataFrame expressions thanks to our "explainer" compiler plugin
33+
[:plugins:expressions-converter](../plugins/expressions-converter).
34+
35+
We can also generate "normal" DataFrame samples for the website. This can be done using the
36+
[OtherSamples class](./src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api/OtherSamples.kt). Generated
37+
HTML files will be stored in [docs/StardustDocs/snippets/manual](../docs/StardustDocs/snippets/manual).
38+
39+
### KDoc Preprocesor
40+
41+
The code you're working on needs to be edited in [src](src), but the KDocs are processed by the
42+
[KDoc Preprocessor](https://github.com/Jolanrensen/docProcessorGradlePlugin) when the project is published (or the task
43+
is run manually). The generated sources with adjusted KDocs will be overwritten
44+
in [generated-sources](generated-sources).
45+
See the [KDoc Preprocessing Guide](../KDOC_PREPROCESSING.md) for more information.
46+
47+
KDocs can also be exported to HTML, for them to be reused on the website.
48+
Elements annotated with `@ExportAsHtml` will have their generated content be copied over to
49+
[docs/StardustDocs/snippets/kdocs](../docs/StardustDocs/snippets/kdocs).

0 commit comments

Comments
 (0)