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

WIP: [19] Assert signature file name syntax #21

Merged
merged 1 commit into from
Dec 31, 2020
Merged

Conversation

mkarg
Copy link
Contributor

@mkarg mkarg commented Dec 30, 2020

This is a first draft of a possible solution for issue #19.

What I am stuck with is how I can access the IT maven project instance from within the postbuild.groovy script? I need that to solve the following issues:

  • SHOULD NOT hard code the version number in the script, as it would imply to change all scripts again and again for each new version of the project.
  • SHOULD NOT hard code the expected file name as a literal, as it would imply to change the script again if more signature files are added to the existing IT test case.

Closes #19

@mkarg mkarg added the code quality Improvements, refactor or code cleanup. label Dec 30, 2020
@mkarg
Copy link
Contributor Author

mkarg commented Dec 30, 2020

@slawekjaranowski I think my personal experience with Maven Invoker Plugin is not good enough to solve the two open questions on my own. Do you have an idea for me?

@slawekjaranowski
Copy link
Member

  • ITs project version is hardcoded in invoker.properties and it is independent of real project version
  • we can have hardcode file names - I prefer more unit test then ITs running by maven-invoker, so I expect that we will not do many changes in it

@mkarg
Copy link
Contributor Author

mkarg commented Dec 30, 2020

I'm driving nuts. Even if I put an additional -Drevision=1.1.1 in the invoker.mavenOpts line, still System.properties.'revision' always returns null (while it works with any other environment variable). Do you have a clue what my fault is?

@slawekjaranowski
Copy link
Member

settings from invoker.properties are used for maven execution not for before/after script.
If you need new values in before/after script you should use scriptVariables configuration for maven-invoker plugin
https://maven.apache.org/plugins/maven-invoker-plugin/examples/post-build-script.html

@mkarg
Copy link
Contributor Author

mkarg commented Dec 30, 2020

That does not solve the problem: The version number is then just moved from the script file to another file, but in any way it would be duplicated. So to sum up: Shall we simply hard-code the version number in the groovy script?

@slawekjaranowski
Copy link
Member

yes we can hardcode version in groovy. We have only 4 ITs tests so will not huge work to change it if we need.

@mkarg mkarg force-pushed the mkarg-19 branch 2 times, most recently from 69d15cd to 650b19e Compare December 31, 2020 08:53
@mkarg
Copy link
Contributor Author

mkarg commented Dec 31, 2020

Ok, in that case I am done with this draft and would kindly ask to review this PR. :-)

@mkarg mkarg marked this pull request as ready for review December 31, 2020 08:59
@mkarg mkarg self-assigned this Dec 31, 2020
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@slawekjaranowski
Copy link
Member

After merging last two PR I will release new version.
If you wish please add yourself to developer list in pom.xml

@mkarg
Copy link
Contributor Author

mkarg commented Dec 31, 2020

After merging last two PR I will release new version.
If you wish please add yourself to developer list in pom.xml

Please Review #24 - Thank you for inviting me into this project! It is fun working with you! :-)

@mkarg mkarg merged commit b693677 into s4u:master Dec 31, 2020
@mkarg mkarg deleted the mkarg-19 branch December 31, 2020 10:54
slawekjaranowski pushed a commit that referenced this pull request Aug 29, 2021
…ot/github_actions/common-files-maven/s4u/setup-maven-action-1.1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Improvements, refactor or code cleanup.
Development

Successfully merging this pull request may close these issues.

Assert signature file name syntax
2 participants