inductiveautomation / ignition-module-tools

Tools that help in the creation and development of Modules for Inductive Automation's Ignition.
49 stars 12 forks source link

Clean up filename and required ignition version templates #40

Closed paul-griffith closed 2 months ago

paul-griffith commented 1 year ago

Fixes #37 Fixes #38

brianeray commented 8 months ago

Hey @paul-griffith. Is this PR still alive? I can review if needed.

And get a clean build; looks like the logs are gone.

paul-griffith commented 8 months ago

Haven't touched it in a long time, obviously, but I think the changes are still valid.

brianeray commented 7 months ago

I don't have privileges to override the checks failure and merge, which is what I would do since these aren't code changes. I might need to bug the inductiveautomation org owners.

KathyApplebaum commented 3 months ago

@brianeray Just stumbled across this. Can you explain to me in simple terms why it's okay to merge with a failed build? Thanks!

brianeray commented 3 months ago

No. Looking at this again, especially this,

what I would do since these aren't code changes

README.md's, OK, perhaps even the changes to the templates. But there's a logic change in ModuleGeneratorContext. What I wrote makes no sense.

This thing should pass a PR build first.

brianeray commented 3 months ago

Trying to get to the PR build failure yields a dead end:

image

The PR workflow has succeeded for other PRs since then, however. This is weird.

brianeray commented 3 months ago

OK I finally tricked it into rebuilding and giving us good output. I've downloaded the failed Gradle log and finally have something to go on.

Stay tuned.

brianeray commented 2 months ago

For internal tracking: IGN-10603.

brianeray commented 2 months ago

@paul-griffith I think I figured it out. It's coming from the current PR. Try this.

> git diff --% --ignore-all-space --color-moved --color-moved-ws=ignore-all-space --
diff --git before:generator/generator-core/src/main/resources/templates/config/modlPluginConfig.groovy after:generator/generator-core/src/main/resources/templates/config/modlPluginC
onfig.groovy
index d2ca25a..22eb18e 100644
--- before:generator/generator-core/src/main/resources/templates/config/modlPluginConfig.groovy
+++ after:generator/generator-core/src/main/resources/templates/config/modlPluginConfig.groovy
@@ -22,7 +22,7 @@ ignitionModule {
      * the course of a major Ignition (7.9, 8.0, etc) version, except for when the Ignition Platform adds/changes APIs
      * used by the module.
      */
-    requiredIgnitionVersion = ext.sdk_version
+    requiredIgnitionVersion = rootProject.ext.sdk_version
     /*
      *  This is a map of String: String, where the 'key' represents the fully qualified path to the project
      *  (using gradle path syntax), and the value is the shorthand Scope string.
diff --git before:generator/generator-core/src/main/resources/templates/config/modlPluginConfig.kts after:generator/generator-core/src/main/resources/templates/config/modlPluginConf
ig.kts
index 176d0db..83122e5 100644
--- before:generator/generator-core/src/main/resources/templates/config/modlPluginConfig.kts
+++ after:generator/generator-core/src/main/resources/templates/config/modlPluginConfig.kts
@@ -25,7 +25,7 @@ ignitionModule {
      * the course of a major Ignition (7.9, 8.0, etc) version, except for when the Ignition Platform adds/changes APIs
      * used by the module.
      */
-    requiredIgnitionVersion.set(sdk_version)
+    requiredIgnitionVersion.set(rootProject.ext.sdk_version)
     /*
      *  This is a map of String: String, where the 'key' represents the fully qualified path to the project
      *  (using gradle path syntax), and the value is the shorthand Scope string.

I'm having problems getting unit tests to pass even after that patch due to Gradle-Windows fighting, but am pretty sure this squashes the thing that is tanking most of the unit tests. This is the kind of test failure up in that build log over and over and over.

io.ia.sdk.gradle.modl.IgnitionModulePluginFunctionalTest > gateway scoped unsigned module passes config and builds with signing credentials STANDARD_OUT
    /tmp/junit5484288864958444835/gwScopedUnsignedConfigAndBuild

    FAILURE: 
    Build failed with an exception.

    * Where:

    Build file '/tmp/junit5484288864958444835/gwScopedUnsignedConfigAndBuild/great-tests/build.gradle' line: 46

    * What went wrong:

    A problem occurred evaluating root project 'great-tests'.

    > 
    Cannot get property 'sdk_version' on extra properties extension as it does not exist
brianeray commented 2 months ago

I'm having problems getting unit tests to pass even after that patch due to Gradle-Windows fighting

OK this is better; I'm not going to run the whole suite locally but it gives confidence in the sdk_version patch.

> .\gradlew.bat --% :gradle-module-plugin:functionalTest --tests=AssembleModuleStructureTest."single file doc is collected"
Type-safe project accessors is an incubating feature.

 ...

BUILD SUCCESSFUL in 1m 20s
12 actionable tasks: 3 executed, 9 up-to-date
brianeray commented 2 months ago

Replaced by #58--just to make it easier for me to grind away at the unit test failures and take this off of Paul's plate.