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

Config files no longer loaded if they contain a hidden path element #54

Closed
mmornati opened this issue Dec 19, 2020 · 6 comments
Closed
Milestone

Comments

@mmornati
Copy link

What?

With recent updates (maybe related to the spring-boot version?) what we did in the release-notes action seems not working anymore.
After some tests I land to the problem related to the --spring.config.location property which is not taken in count.

java -jar /github-release-notes-generator.jar \
    --changelog.repository=${OWNER_ID}/${REPOSITORY_NAME} \
    --changelog.github.username=${GH_USERNAME} \
    --changelog.github.password=${GITHUB_TOKEN} \
    --changelog.milestone-reference=id \
    --spring.config.location=${CONFIG_FILE} \
    ${MILESTONE_NUMBER} \
    ${OUTPUT_FOLDER}/${OUTPUT_FILENAME}

It always using the default configuration file from the application. So all the custom labels are not taken in count.

How to test?

Create a file with custom labels configuration like the following:

changelog:
  repository: mmornati/test-relese-notes
  sections:
  - title: ":star: Features"
    labels: [ "Feature" ]
  - title: ":chart_with_upwards_trend: Enhancements"
    labels: [ "Enhancement" ]
  - title: ":beetle: Bug Fixes"
    labels: [ "Bug" ]
  - title: ":hammer_and_wrench: Dependency Upgrade"
    labels: [ "Type: Dependency Upgrade" ]
  issues:
    exclude:
      labels: [ "Type: Incorrect Repository", "Type: Question" ]
  contributors:
    exclude:
      names: [ "dependabot" ]

Run the 0.0.5 version with the following command:

java -jar github-changelog-generator.jar  --changelog.milestone-reference=id --debug --spring.config.location=your-custom.yml 1 test.md

In this way you will have an error because the repository (in the configuration file) is not taken in count.
If you execute in the following way:

java -jar github-changelog-generator.jar --changelog.repository=mmornati/test-relese-notes --changelog.milestone-reference=id --debug --spring.config.location=your-custom.yml 1 test.md

It will work but without the custom labels from the milestone.

If you have any hint about it...

@mmornati
Copy link
Author

Thanks to all the @lfgcampos tests, we have a workaround.
It seems the problem is coming from the location where the file is put. For GitHub actions we are storing files into a .github folted. Moving the configuration in a different location seems to fix the problem.
Seems crazy to me... Is there anything we can do to keep the correct location for actions?

@lfgcampos
Copy link

Just to update here as well, seems like if we try the same from above but running master, it works.
I would say spring-boot v2.4.1 (or v2.3.7) already have a fix for that!

Can we expect a new release soon? It would be very benefical for us =)

@mmornati
Copy link
Author

I found about the issue here and it seems really related to the Spring Boot version. spring-projects/spring-boot#23983
If it possible to release a beta version of the 0.0.6 snapshot? We will base the GitHub action on that one.

@snicoll
Copy link
Collaborator

snicoll commented Dec 19, 2020

Sorry it broke you on upgrading. You could perhaps using 0.0.4 in the meantime?

If it possible to release a beta version of the 0.0.6 snapshot?

We'd rather release 0.0.6. There is already a docker image with the fix, see the 0.0.6-SNAPSHOT tag (c209d3d2d1f2). If you're not using the docker image, you can build the project locally.

@snicoll snicoll changed the title request: external config location not working Config files no longer loaded if they contain a hidden path element Dec 20, 2020
@snicoll snicoll added this to the 0.0.6 milestone Dec 20, 2020
@snicoll
Copy link
Collaborator

snicoll commented Dec 20, 2020

Fixed by 5bbdbdc

@snicoll snicoll closed this as completed Dec 20, 2020
@mmornati
Copy link
Author

Thanks @snicoll for your feedback. We are using a temporary built jar in the action waiting for the final release of the 0.0.6.

We can't use directly the Docker because we need an entry point (or whatever else more than the jar) to run the project as github action.
I think with some little changes to the Docker the action can even being released directly by this project :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants