Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix config auto-generation #131

Merged
merged 11 commits into from
Apr 12, 2022
Merged

Fix config auto-generation #131

merged 11 commits into from
Apr 12, 2022

Conversation

ckittl
Copy link
Member

@ckittl ckittl commented Feb 8, 2022

Fixes #130
Fixes #148

@ckittl ckittl added the bug Something isn't working label Feb 8, 2022
@ckittl ckittl added this to the Version 3.0 milestone Feb 8, 2022
@ckittl ckittl requested a review from a team February 8, 2022 13:10
@ckittl ckittl self-assigned this Feb 8, 2022
@johanneshiry
Copy link
Member

johanneshiry commented Feb 8, 2022

  1. CI is broken
  2. I would prefer to know exactly where, that is in which PR this stuff has become broken. Doesn't feel well for me to approve & merge stuff where we assume that this might have been broken some time w/o knowing the source of this apparently invalid code! In particular not bc current dev is not broken (at least CI is passing?).

Copy link
Member

@sebastian-peter sebastian-peter left a comment

Choose a reason for hiding this comment

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

I just have some tscfg-related comments. The long comment could also be addressed in a separate PR.

Furthermore, genConfigSample currently does not work without specifying a destination directory for config classes (--dd). Looks like a bug in tscfg, I will investigate further. Edit: We might also think about simplifying the workflow and generating a config template each time a config class is generated.

gradle/scripts/tscfg.gradle Show resolved Hide resolved
gradle/scripts/tscfg.gradle Outdated Show resolved Hide resolved
@sonarqubegithubprchecks

This comment has been minimized.

@codecov
Copy link

codecov bot commented Feb 17, 2022

Codecov Report

Merging #131 (97e551a) into dev (ac43abf) will increase coverage by 0.06%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##              dev     #131      +/-   ##
==========================================
+ Coverage   79.55%   79.62%   +0.06%     
==========================================
  Files         156      156              
  Lines        5757     5757              
  Branches       79       79              
==========================================
+ Hits         4580     4584       +4     
+ Misses       1177     1173       -4     
Impacted Files Coverage Δ
...e3/simona/agent/participant/ParticipantAgent.scala 78.40% <0.00%> (-4.55%) ⬇️
...n/scala/edu/ie3/simona/config/ConfigFailFast.scala 90.18% <0.00%> (-0.50%) ⬇️
...cala/edu/ie3/simona/config/ConfigConventions.scala 100.00% <0.00%> (ø)
...ain/scala/edu/ie3/simona/config/SimonaConfig.scala 61.94% <0.00%> (+1.04%) ⬆️
.../scala/edu/ie3/simona/config/RefSystemParser.scala 100.00% <0.00%> (+2.85%) ⬆️
...in/scala/edu/ie3/simona/config/VoltLvlParser.scala 62.50% <0.00%> (+17.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ac43abf...97e551a. Read the comment docs.

@sonarqubegithubprchecks

This comment has been minimized.

@sebastian-peter
Copy link
Member

sebastian-peter commented Feb 22, 2022

I still get a FileNotFoundException: \tmp\ExampleCfg.java when executing genConfigSample, is it just me?

If not, #148 should probably be fixed in a different PR.

Copy link
Member

@johanneshiry johanneshiry left a comment

Choose a reason for hiding this comment

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

Thanks for your work. Looks 90% good to me. You may consider my suggestions with a slightly increased verbosity (verbosity has been high already, but I thought an additional hint might be helpful). Additionally, I have one questions regarding the deleted part of the experiments config as I couldn't find anything about it in the linked issues. You might explain the removal.

Thanks again :)

Comment on lines -32 to -60
task genExperimentsConfigClass {
doLast {
def tscfgJarFile = project.file('build/tscfg-' + tscfgVersion + '.jar')
if (!tscfgJarFile.exists() || !tscfgJarFile.isFile()) {
download {
src 'https://github.com/carueda/tscfg/releases/download/v' + tscfgVersion + '/tscfg-' + tscfgVersion + '.jar'
dest buildDir
}
}
javaexec {
main = "-jar"
args = [
"build/tscfg-${tscfgVersion}.jar",
"--spec",
"src/main/resources/config/experiments-config-template.conf",
"--scala",
"--durations",
"--pn",
"edu.ie3.simona.config",
"--cn",
"ExperimentsConfig",
"--dd",
"src/main/scala/edu/ie3/simona/config/"
]
}
}
}


Copy link
Member

Choose a reason for hiding this comment

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

Why? Does not relate to #130 nor #148

Copy link
Member Author

Choose a reason for hiding this comment

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

I just recognized in the discussion with sebastian that this is code, that was meant to be introduced with #66, but due to some error already is in code base right now.

src/main/scala/edu/ie3/simona/config/ConfigFailFast.scala Outdated Show resolved Hide resolved
src/main/scala/edu/ie3/simona/config/ConfigFailFast.scala Outdated Show resolved Hide resolved
@sonarqubegithubprchecks

This comment has been minimized.

ckittl and others added 3 commits March 8, 2022 10:56
@ckittl
Copy link
Member Author

ckittl commented Mar 8, 2022

I still get a FileNotFoundException: \tmp\ExampleCfg.java when executing genConfigSample, is it just me?

If not, #148 should probably be fixed in a different PR.

According to the error message, you quoted, I assume you are running the command in windows os?

by choosing the OS dependent temporary file path
@sonarqubegithubprchecks

This comment has been minimized.

@ckittl ckittl requested a review from johanneshiry March 8, 2022 12:37
@ckittl
Copy link
Member Author

ckittl commented Mar 8, 2022

I still get a FileNotFoundException: \tmp\ExampleCfg.java when executing genConfigSample, is it just me?
If not, #148 should probably be fixed in a different PR.

According to the error message, you quoted, I assume you are running the command in windows os?

Okay... It was an issue with the default destination directory in tscfg. I handed in a PR at carueda/tscfg#151, that might make this workaround obsolete.

@ckittl
Copy link
Member Author

ckittl commented Mar 11, 2022

I still get a FileNotFoundException: \tmp\ExampleCfg.java when executing genConfigSample, is it just me?
If not, #148 should probably be fixed in a different PR.

According to the error message, you quoted, I assume you are running the command in windows os?

Okay... It was an issue with the default destination directory in tscfg. I handed in a PR at carueda/tscfg#151, that might make this workaround obsolete.

Merged, but not yet released.

Copy link
Member

@sebastian-peter sebastian-peter left a comment

Choose a reason for hiding this comment

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

With this workaround, genConfigSample works again, thank you. I created #178 to remove the workaround once it's not necessary anymore. So from my side, this is good to go.

@t-ober t-ober self-assigned this Apr 10, 2022
Copy link
Contributor

@t-ober t-ober left a comment

Choose a reason for hiding this comment

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

Looks good - thanks!

@t-ober t-ober self-requested a review April 11, 2022 13:06
Copy link
Contributor

@t-ober t-ober left a comment

Choose a reason for hiding this comment

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

Looks good codewise. But the Branch can't be built because of some issues in the PrimaryServiceProxy e.g. PrimaryServiceProxy.scala:151:16: value timeSeriesMetaInformation is not a member of edu.ie3.datamodel.io.source.csv.CsvTimeSeriesMappingSource

Please check that before merging. Although I'm not quite sure why this issue occurs since the class was not touched. I think some changes in main might not have been merged into this branch correctly

@sonarqubegithubprchecks
Copy link

Passed

Analysis Details

0 Issues

  • Bug0 Bugs
  • Vulnerability0 Vulnerabilities
  • Code Smell0 Code Smells

Coverage and Duplications

  • 100 percent coverage100.00% Coverage (81.80% Estimated after merge)
  • 3 percent duplication0.00% Duplicated Code (0.00% Estimated after merge)

Project ID: edu.ie3:simona

View in SonarQube

@sebastian-peter
Copy link
Member

This branch was just way out of sync with dev. A merge fixed everything.

@t-ober t-ober merged commit 6348f8c into dev Apr 12, 2022
@t-ober t-ober deleted the ck/#130-fixConfigAutoGeneration branch April 12, 2022 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix genConfigSample gradle task Fix config auto-generation
4 participants