Skip to content

Initial version - #5

Open
gerritdrost wants to merge 19 commits into
mainfrom
initial-version
Open

Initial version#5
gerritdrost wants to merge 19 commits into
mainfrom
initial-version

Conversation

@gerritdrost

Copy link
Copy Markdown

Merge instructions

This PR is a merger of work by @Mahmuttumkaya, @wei-qiang and me. A merge without squash has our preference as it retains authorship of the code, which has our preference.

From now on we aim to provide concise PR's which can then be squash merged.

Changes in this PR

Java project that implements a wrapper to the PGM C library. Currently implemented:

  • a Gradle build pipeline that downloads PGM binaries and headers and uses JExtract to generate a wrapper
  • Java code to:
    • automatically load the included PGM binaries for supported platforms,
    • OR check if (a manually loaded) PGM binary is available, and optionally if version matches the ones of the headers used to generate the Java wrapper (for all unsupported platforms that do support C and Java)
  • automatic application of code style and license headers in Java files
  • basic CI pipeline that builds the project, performs code style checks and runs unit tests
  • A Java translation of the PGM example (power_grid_model_c_example/main.c)

Future improvements

A non-exhaustive list of things we should improve in the future:

  • clean up the build setup (move the custom tasks into a buildSrc-dir, which would clean up the mess in build.gradle)
  • automatic application of license headers in non-Java files
  • write/improve documentation

gerritdrost and others added 14 commits August 4, 2026 15:24
Signed-off-by: Gerrit Drost <gerrit.drost@alliander.com>
Signed-off-by: Mahmut Tumkaya <mahmut.tumkaya@alliander.com>
Signed-off-by: Gerrit Drost <gerrit.drost@alliander.com>
Signed-off-by: Mahmut Tumkaya <mahmut.tumkaya@alliander.com>
Signed-off-by: Gerrit Drost <gerrit.drost@alliander.com>
Signed-off-by: Wei-Qiang Zhou <wei-qiang.zhou@alliander.com>
Signed-off-by: Gerrit Drost <gerrit.drost@alliander.com>
- uses DSA code style (through eclipse code style file)
- adds licence header to all Java files

Signed-off-by: Wei-Qiang Zhou <wei-qiang.zhou@alliander.com>
- Add license header to gradle files
- Remove license header from gradle-wrapper.properties

Signed-off-by: Wei-Qiang Zhou <wei-qiang.zhou@alliander.com>
- Add github workflow
- Move fileTree call out of doLast
- Add license header
- Remove author and description in actions

Signed-off-by: Wei-Qiang Zhou <wei-qiang.zhou@alliander.com>
Signed-off-by: Gerrit Drost <gerrit.drost@alliander.com>
Signed-off-by: Gerrit Drost <gerrit.drost@alliander.com>
…n message

Signed-off-by: Gerrit Drost <gerrit.drost@alliander.com>
Signed-off-by: Gerrit Drost <gerrit.drost@alliander.com>
@TonyXiang8787 TonyXiang8787 added the feature New feature or request label Aug 6, 2026
Comment thread .github/actions/setup-runtime/action.yml Outdated
Comment thread config/pmd/ruleset.xml Outdated
Comment thread build.gradle
publications {
mavenJava(MavenPublication) {
from components.java
artifactId = 'lib-power-grid-model'

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this name right?

Signed-off-by: Djamel van der Sluis <djamel.van.der.sluis@alliander.com>
Signed-off-by: Wei-Qiang Zhou <wei-qiang.zhou@alliander.com>
Signed-off-by: Wei-Qiang Zhou <wei-qiang.zhou@alliander.com>
Comment on lines +31 to +32
id-token: write # Needed to load credentials
contents: read # Needed to read repository (content)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are unused right?

env:
LOCAL_IMAGE_TAG: ${{ inputs.local_image_tag }}
DEPLOY_BRANCH: ${{ inputs.deploy_branch }}
IMAGE_REPOSITORY_PREFIX: ${{ inputs.image_repository_prefix }}${{ inputs.namespace }}

@nitbharambe nitbharambe Aug 21, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These inputs aren't mentioned above.
And the env variables are unused as well?

Comment on lines +70 to +78
- name: Create Build Tag
id: create_tag
uses: ./.github/actions/create-build-tag

- name: Repository Name
id: repo
shell: bash
run: |
echo "name=${GITHUB_REPOSITORY#*/}" >> "$GITHUB_OUTPUT"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this and the create-build-tag action is unused as well.

Add a reusable-workflow job in java gradle ci to execute reuse-compliance as part of the main CI pipeline

Signed-off-by: Mahmut Tumkaya <mahmut.tumkaya@alliander.com>
@nitbharambe

Copy link
Copy Markdown
Member

Great PR! This would concludes DGC's review on things apart from java things.
Feel free to remove the checklist from README when done.

Maybe already addressed and answered:
Regarding licenses automatically applying: a .license file can be added for the expected files instead which serves as fallback for the inital header comments on file. If the file name itself is changing, then maybe it can be handled via CI.

Signed-off-by: Wei-Qiang Zhou <wei-qiang.zhou@alliander.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants