Skip to content

Commit

Permalink
Merge develop into main (#242)
Browse files Browse the repository at this point in the history
* feat(216): check that Datasets, FCDAs, ControlBlocks (GOOSE, REPORT and SMV) satisfy limits fixed by config

Signed-off-by: Aliou DIAITE <[email protected]>

* build(deps): bump alex-page/github-project-automation-plus

Bumps [alex-page/github-project-automation-plus](https://github.com/alex-page/github-project-automation-plus) from 0.8.2 to 0.8.3.
- [Release notes](https://github.com/alex-page/github-project-automation-plus/releases)
- [Commits](alex-page/github-project-automation-plus@v0.8.2...v0.8.3)

---
updated-dependencies:
- dependency-name: alex-page/github-project-automation-plus
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* feat(216): check that Datasets, FCDAs, ControlBlocks (GOOSE, REPORT and SMV) satisfy limits fixed by config

Signed-off-by: Aliou DIAITE <[email protected]>

* chore(217): use built-in Maven cache mechanism of setup-java GitHub
Action

fixes #217

Signed-off-by: Aurélien Pupier <[email protected]>

* Fix typos in docs

Signed-off-by: Aurélien Pupier <[email protected]>

* feat/javadoc: automate Javadoc deployment via gh-pages (#229)

fixes maven plugin related to jdk17

Signed-off-by: Samir Romdhani <[email protected]>

feat/javadoc: automate Javadoc remove PR creation and push directly gh-pages branch

* feat(231): Automatic binding: Edit InRef from ExtRef

Signed-off-by: SaintierFr <[email protected]>

* fix(#235): Error occurs when importing STD file during SCD automated creation

Signed-off-by: SaintierFr <[email protected]>

* fix(#239): Exclude DOI Mod-stVal in DAI updatability check (#240)

* fix(#239): Exclude DOI Mod-stVal in DAI updatability check
* fix(#239): Comment unit test in error while bug #241 is not fixed

Signed-off-by: SaintierFr <[email protected]>

---------

Signed-off-by: Aliou DIAITE <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Aurélien Pupier <[email protected]>
Signed-off-by: SaintierFr  <[email protected]>
Signed-off-by: SaintierFr <[email protected]>
Co-authored-by: Aliou DIAITE <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Wilbrink <[email protected]>
Co-authored-by: Aurélien Pupier <[email protected]>
Co-authored-by: Samir Romdhani <[email protected]>
  • Loading branch information
6 people authored Feb 16, 2023
1 parent 05da69b commit 4c4c7a4
Show file tree
Hide file tree
Showing 46 changed files with 3,102 additions and 403 deletions.
50 changes: 26 additions & 24 deletions .github/workflows/automate_javadoc.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
# SPDX-FileCopyrightText: 2022 RTE FRANCE
# SPDX-FileCopyrightText: 2022 2023 RTE FRANCE
#
# SPDX-License-Identifier: Apache-2.0
name: Continuous Deployment - JavaDocs

on:
push:
branches:
- 'feat/javadoc'
pull_request_target:
types: [ labeled, closed ]

jobs:
build:
if: ${{ github.event.pull_request.base.ref == 'develop' && github.actor != 'dependabot[bot]' && github.event.pull_request.merged && contains(github.event.pull_request.labels.*.name, 'javadoc') }}
name: Java Docs
runs-on: ubuntu-latest
env:
from_branch: feat/javadoc
target_branch: feat/117_Documentation_SCD_Generation_Process
DEPLOYMENT_BRANCH: gh-pages
DEPENDABOT_BRANCH: dependabot/javadoc-${{ github.head_ref || github.ref_name }}-${{ github.event.pull_request.number }}
steps:
# Use develop as base branch to generate javadoc
- name: Setup Environment
- name: Checkout
uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
ref: ${{ env.target_branch }}

- name: Create custom Maven Settings.xml
uses: whelk-io/maven-settings-xml-action@v21
Expand All @@ -33,6 +35,8 @@ jobs:
run: |
git config --global user.name '${{ secrets.CONFIG_CI_USER_NAME }}'
git config --global user.email '${{ secrets.CONFIG_CI_USER_EMAIL }}'
git config pull.rebase false
git fetch origin ${{ env.DEPLOYMENT_BRANCH }}
- name: Import GPG key
id: import_gpg
Expand All @@ -42,27 +46,25 @@ jobs:
git_user_signingkey: true
git_commit_gpgsign: true

- name: Prepare Pull Request branch
# Take note that your GitHub Pages site is currently being built from the /docs folder in the DEPLOYMENT_BRANCH branch.
- name: Prepare Pull Request branch & commit files
run: |
mvn -s custom_maven_settings.xml clean javadoc:aggregate -P javadoc
mkdir -p docs/javadoc
yes | cp -Rf target/site/apidocs/* docs/javadoc/
git checkout -b ${{ env.from_branch }}-pull-request
git checkout -b temp
git add docs/javadoc/
git commit -m "[dependabot/javadoc/temp]: update javadoc"
git checkout ${{ env.DEPLOYMENT_BRANCH }}
git clean -fdx
git checkout -b ${{ env.DEPENDABOT_BRANCH }}
git cherry-pick -n -X theirs temp
git commit -m "[dependabot/javadoc]: update javadoc"
git checkout ${{ env.DEPLOYMENT_BRANCH }}
git merge ${{ env.DEPENDABOT_BRANCH }}
# Note that will fail if branch already exists.
- name: Push Git Branch
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ env.from_branch }}-pull-request

# Note that will silently fail if PR already exists.
- name: Create Pull Request
uses: repo-sync/pull-request@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
source_branch: ${{ env.from_branch }}-pull-request
destination_branch: ${{ env.target_branch }}
pr_title: "Docs: Update Java docs repository"
pr_body: "Automatically created from CI workflow"
pr_label: "documentation,javadoc"
branch: ${{ env.DEPLOYMENT_BRANCH }}
8 changes: 4 additions & 4 deletions .github/workflows/automate_projects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,29 @@ jobs:
steps:
- name: add-new-issues-to-repository-based-project-column
if: github.event_name == 'issues' && github.event.action == 'opened'
uses: alex-page/[email protected].2
uses: alex-page/[email protected].3
with:
project: CoMPAS SCT Board
column: To do
repo-token: ${{ secrets.ORG_GITHUB_ACTION_SECRET }}
- name: add-new-pull-request-to-repository-based-project-column
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.action == 'opened'
uses: alex-page/[email protected].2
uses: alex-page/[email protected].3
with:
project: CoMPAS SCT Board
column: To do
repo-token: ${{ secrets.ORG_GITHUB_ACTION_SECRET }}

- name: add-new-issues-to-organization-based-project-column
if: github.event_name == 'issues' && github.event.action == 'opened'
uses: alex-page/[email protected].2
uses: alex-page/[email protected].3
with:
project: CoMPAS Issues Overview Board
column: To do
repo-token: ${{ secrets.ORG_GITHUB_ACTION_SECRET }}
- name: add-new-pull-request-to-organization-based-project-column
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.action == 'opened'
uses: alex-page/[email protected].2
uses: alex-page/[email protected].3
with:
project: CoMPAS Pull Request Overview Board
column: To do
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/sonarcloud-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,18 @@ jobs:
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
cache: 'maven'

- name: Set Common Sonar Variables
id: sonar_env
run: |
echo "##[set-output name=sonar_opts;]$(echo -Dsonar.host.url=https://sonarcloud.io \
-Dsonar.projectKey=com-pas_compas-core \
-Dsonar.projectKey=com-pas_compas-sct \
-Dsonar.organization=com-pas )"
- name: Create custom Maven Settings.xml
uses: whelk-io/maven-settings-xml-action@v21
Expand Down
20 changes: 10 additions & 10 deletions docs/HOME.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Technical Steering Committee [[email protected]](mailto:CoMPAS-tsc@l
By contributing to the CoMPAS project, you accept and agree to the following terms and conditions for your present and future contributions submitted to CoMPAS.

All contributions to this project are licensed under the license stipulated at the corresponding sub-repository.
Except where otherwise explicitely indicated, CoMPAS is an open source project licensed under the [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0/).
Except where otherwise explicitly indicated, CoMPAS is an open source project licensed under the [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0/).

The project requires the use of the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
The DCO is a legally binding statement asserting that you are you have the right to submit your contribution and to license it under the project's applicable license.
Expand All @@ -64,21 +64,21 @@ Note that checks will be performed during the integration in order to require th

## Community refinements

Every monday there is a CoMPAS Community Refinement at 10AM CET. The event is available at the CoMPAS mailing list [calendar](https://lists.lfenergy.org/g/CoMPAS/calendar) and can be subscribed to.
Every Monday there is a CoMPAS Community Refinement at 10AM CET. The event is available at the CoMPAS mailing list [calendar](https://lists.lfenergy.org/g/CoMPAS/calendar) and can be subscribed to.

### Prepared topics

Every friday before the refinement meeting on Monday, all topics are published on the #compas channel on our [LFEnergy Slack](https://lfenergy.slack.com/).
Every Friday before the refinement meeting on Monday, all topics are published on the #compas channel on our [LFEnergy Slack](https://lfenergy.slack.com/).

### Add your own topics

Everybody can suggest topics for the refinement. To do this, join the [LFEnergy Slack](https://lfenergy.slack.com/) if not already, and put your topics in the #compas channel. You can just do this by writing a message like "I want to add something to the refinement this monday, namely..." or add a comment to the already prepared topics if available (see [Prepared topics](#prepared-topics)).
Everybody can suggest topics for the refinement. To do this, join the [LFEnergy Slack](https://lfenergy.slack.com/) if not already, and put your topics in the #compas channel. You can just do this by writing a message like "I want to add something to the refinement this Monday, namely..." or add a comment to the already prepared topics if available (see [Prepared topics](#prepared-topics)).

### Reporting Bugs and Suggesting Enhancements

Bugs and enhancement suggestions are tracked as [GitHub issues](https://guides.github.com/features/issues/). Create an issue in the repository where it belongs (an issue about the CIM to IEC 61850 mapping belongs in the [CIM Mapping repository](https://github.com/com-pas/compas-cim-mapping) for example) and provide the following information by filling in the template, which is either an issue or a bug.

When an issue is created, it is automatically being added to the `To do` column of the specific repository. This means it's added, but not yet refined. Every monday at 10AM CET, there is a Community Refinement (see our mailing list [calendar](https://lists.lfenergy.org/g/CoMPAS/calendar), everybody can join) where issues are being discussed that are not refined yet. Your issue is one of them.
When an issue is created, it is automatically being added to the `To do` column of the specific repository. This means it's added, but not yet refined. Every Monday at 10AM CET, there is a Community Refinement (see our mailing list [calendar](https://lists.lfenergy.org/g/CoMPAS/calendar), everybody can join) where issues are being discussed that are not refined yet. Your issue is one of them.
Once it's accepted and refined, it goes to the `Ready for development` column and it's ready to be implemented/fixed.

Before creating bug reports or suggesting enhancement, please **perform a [cursory search](https://github.com/search?q=+is%3Aissue+user%3Acom-pas)**
Expand Down Expand Up @@ -118,8 +118,8 @@ Continuous integration is set up to run on all branches automatically and will o
### Tools to contribute

Continuous integration is setup automatically on all contributions. However, it's faster to iterate locally to fix problems than waiting for the status checks to finish.
There are many tools that can be used to do the verifications that are enforced by all status checks. The most simple and universal tool is maven, but IDE integrations
can be used to get more immediate feedback. Most of the team uses IntelliJ IDEA, but others IDEs can be used, for exemple the Eclipse IDE.
There are many tools that can be used to do the verifications that are enforced by all status checks. The most simple and universal tool is Maven, but IDE integrations
can be used to get more immediate feedback. Most of the team uses IntelliJ IDEA, but others IDEs can be used, for example the Eclipse IDE.

### Definition of Done

Expand Down Expand Up @@ -147,7 +147,7 @@ On the [developing](https://com-pas.github.io/contributing/DEVELOPING.html) page

#### Open Community Calls

It's good to know that every other monday, we are having a so called Open Community Call. Everyone participating in the CoMPAS project can join
It's good to know that every other Monday, we are having a so called Open Community Call. Everyone participating in the CoMPAS project can join
and talk about and ask question about the CoMPAS project.

When the Open Community Calls are taking place, can be found at the [General CoMPAS mailing list calendar](https://lists.lfenergy.org/g/CoMPAS/calendar).
Expand All @@ -167,7 +167,7 @@ A good (open source) project requires documentation. We have two places for our

##### LF Energy Wiki

LF Energy has it's own [CoMPAS specific Wiki](https://wiki.lfenergy.org/display/HOME/CoMPAS). This is the place for documenation
LF Energy has it's own [CoMPAS specific Wiki](https://wiki.lfenergy.org/display/HOME/CoMPAS). This is the place for documentation
about CoMPAS in general (like roadmap and the community call agendas).

#### Architecture and technologies
Expand All @@ -178,7 +178,7 @@ please check the source code (duh!) and our [CoMPAS Architecture Github Pages](h
### Copyright and Licensing

Copyright and license information is done on per-file basis. We use the specification of [REUSE](https://reuse.software/spec/)
to ensure that copyright information of the project is clear and can be analuzed in an automated fashion.
to ensure that copyright information of the project is clear and can be analyzed in an automated fashion.

Every source code repository within CoMPAS has a Github Action for checking against the REUSE specification.

Expand Down
2 changes: 1 addition & 1 deletion docs/compas-sct.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ import it in the temporary SCD file
</SCL>
```
Operations can now be realized and validated on this minimal file (which has the same structure as an ICD file).
Any validation on the minimal file guaranties a valid integration of those chunks into the large file.
Any validation on the minimal file guarantees a valid integration of those chunks into the large file.

> **WARNING:** This concern only update/creation operations on SCL file.
Expand Down
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@
<configuration>
<doctitle>${javadoc.title}</doctitle>
<doclint>${javadoc.lint}</doclint>
<additionalJOption>--no-module-directories</additionalJOption>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

/**
* <h3>sct-app is a group of automation services</h3>
* <h2>sct-app is a group of automation services</h2>
*/
package org.lfenergy.compas.sct.app;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// SPDX-FileCopyrightText: 2023 RTE FRANCE
//
// SPDX-License-Identifier: Apache-2.0

package org.lfenergy.compas.sct.commons.dto;

public enum ExtrefTarget {
SRC_REF, SRC_CB
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,4 @@ public class SclReport {
public boolean isSuccess() {
return sclReportItems.stream().noneMatch(SclReportItem::isFatal);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
// SPDX-License-Identifier: Apache-2.0

/**
* <h3>sct.commons.dto is a group of DTO utils for operating on
* <h2>sct.commons.dto is a group of DTO utils for operating on
* {@link org.lfenergy.compas.scl2007b4.model.SCL SCL} services
* </h3>
* </h2>
*/
package org.lfenergy.compas.sct.commons.dto;
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
public class ExtRefService {

private static final String MESSAGE_MISSING_IED_NAME_PARAMETER = "IED.name parameter is missing";
private static final String CLIENT_IED_NAME = "The Client IED ";

/**
* Updates iedName attribute of all ExtRefs in the Scd.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@

import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

import org.lfenergy.compas.scl2007b4.model.TExtRef;
import org.lfenergy.compas.scl2007b4.model.TLLN0Enum;
import org.lfenergy.compas.sct.commons.dto.ExtrefTarget;
import org.lfenergy.compas.sct.commons.util.Utils;

/**
* A representation of the model object
Expand Down Expand Up @@ -38,7 +41,7 @@ public class ObjectReference {
private static final String MALFORMED_OBJ_REF = "Malformed ObjRef : %s" ;

private final String reference;
//IEDName.LDInst
//IEDNameLDInst
private String ldName;
//LNPrefixLNClassLNInst
private String lNodeName;
Expand All @@ -49,14 +52,30 @@ public ObjectReference(String reference) {
init();
}

public ObjectReference(TExtRef extRef, ExtrefTarget target) {
this.ldName = extRef.getIedName() + extRef.getLdInst();
if(target.equals(ExtrefTarget.SRC_REF)) {
this.lNodeName = Utils.emptyIfBlank(extRef.getPrefix())
+ (extRef.isSetLnClass() ? extRef.getLnClass().get(0): TLLN0Enum.LLN_0.value())
+ Utils.emptyIfBlank(extRef.getLnInst());
this.dataAttributes = Utils.emptyIfBlank(extRef.getDoName());
}
if(target.equals(ExtrefTarget.SRC_CB)) {
this.lNodeName = Utils.emptyIfBlank(extRef.getSrcPrefix())
+ (extRef.isSetSrcLNClass() ? extRef.getSrcLNClass().get(0): TLLN0Enum.LLN_0.value())
+ Utils.emptyIfBlank(extRef.getSrcLNInst());
this.dataAttributes = Utils.emptyIfBlank(extRef.getSrcCBName());
}
this.reference = this.ldName + "/" + this.lNodeName + "." + this.dataAttributes;
}

public final void init(){
String refCopy = reference;
String[] objRefPart = reference.split("[/]");
String[] objRefPart = reference.split("/");
if(objRefPart.length != 2 || StringUtils.isBlank(objRefPart[0]) || StringUtils.isBlank(objRefPart[1])){
throw new IllegalArgumentException(String.format(MALFORMED_OBJ_REF, reference));
}
ldName = objRefPart[0];
refCopy = objRefPart[1];
String refCopy = objRefPart[1];
objRefPart = refCopy.split("[.]", 2);
if(objRefPart.length != 2 || StringUtils.isBlank(objRefPart[0]) || StringUtils.isBlank(objRefPart[1])){
throw new IllegalArgumentException(String.format(MALFORMED_OBJ_REF, reference));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import javax.xml.bind.JAXBElement;
import java.util.*;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static org.lfenergy.compas.sct.commons.util.CommonConstants.*;
Expand Down Expand Up @@ -298,21 +299,23 @@ public static String stdCheckFormatExceptionMessage(TPrivate key) throws ScdExce


/**
* Creates map of IEDName and related Private for all Privates COMPAS-ICDHeader in /Substation of SCL
* Creates stream of Private for all Privates COMPAS-ICDHeader in /Substation of SCL
*
* @param scdRootAdapter SCL file in which Private should be found
* @return map of Private and its IEDName parameter
* @return stream of COMPAS-ICDHeader Private
*/
public static Stream<TPrivate> createMapIEDNameAndPrivate(SclRootAdapter scdRootAdapter) {
public static Stream<TPrivate> streamIcdHeaderPrivatesWithDistinctIEDName(SclRootAdapter scdRootAdapter) {
return scdRootAdapter.getCurrentElem().getSubstation().get(0).getVoltageLevel().stream()
.map(TVoltageLevel::getBay).flatMap(Collection::stream)
.map(TBay::getFunction).flatMap(Collection::stream)
.map(TFunction::getLNode).flatMap(Collection::stream)
.map(TLNode::getPrivate).flatMap(Collection::stream)
.filter(tPrivate ->
tPrivate.getType().equals(COMPAS_ICDHEADER.getPrivateType())
&& PrivateService.extractCompasICDHeader(tPrivate).isPresent()
&& PrivateService.extractCompasICDHeader(tPrivate).get().getIEDName() != null);
&& PrivateService.extractCompasICDHeader(tPrivate).map(TCompasICDHeader::getIEDName).isPresent())
.collect(Collectors.groupingBy(tPrivate -> PrivateService.extractCompasICDHeader(tPrivate).get().getIEDName()))
.values().stream()
.map(tPrivates -> tPrivates.get(0));
}


Expand Down
Loading

0 comments on commit 4c4c7a4

Please sign in to comment.