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

Change yaml parser to yamlbeans #995

Merged
merged 2 commits into from
Jan 9, 2024
Merged

Change yaml parser to yamlbeans #995

merged 2 commits into from
Jan 9, 2024

Conversation

imbyungjun
Copy link
Contributor

snakeyaml 1.x has security vulnerability. So, I tried to bump it up to 2.x. But, the snakeyaml is related to spring framework also. When the snakeyaml is found on classpath, spring try to use the given snakeyaml to handling yaml property file.

Most of spring-boot versions are depend on snakeyaml 1.x except latest version of spring-boot. I think that upgrade spring-boot to latest version will take long time. So, just change the yaml parser to yamlbeans that has most stars library in yaml official website except snakeyaml.

@imbyungjun imbyungjun self-assigned this Jan 8, 2024
@@ -278,25 +278,26 @@ public Set<GitHubConfig> getAllGitHubConfig(User user) throws FileNotFoundExcept
return getAllGithubConfig(gitConfigYaml);
}

private Set<GitHubConfig> getAllGithubConfig(FileEntry gitConfigYaml) {
protected Set<GitHubConfig> getAllGithubConfig(FileEntry gitConfigYaml) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why modifier was changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was changed it for adding a unit test. But, it doesn't need to change access modifier.
I will change it back to private and add a unit test to verify that successfully parse the .gitconfig.yml file.

donggyu04
donggyu04 previously approved these changes Jan 8, 2024
Copy link

github-actions bot commented Jan 9, 2024

❌ Build & Test workflow failed ❌


@Before
public void before() throws IOException {
File file = new File(System.getProperty("java.io.tmpdir"), "repo");
Copy link
Contributor

Choose a reason for hiding this comment

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

How about use Junit TempDir?
It will be deleted automatically after test

Copy link
Contributor Author

@imbyungjun imbyungjun Jan 9, 2024

Choose a reason for hiding this comment

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

We are using junit 4.13.1 😭. And TempDir seems to be supported since Junit5.

junit.version=4.13.1

I tried to use TempDir but it fails to get temp directory file via @TempDir annotation.

@imbyungjun imbyungjun merged commit 1a28741 into develop Jan 9, 2024
0 of 2 checks passed
@imbyungjun imbyungjun deleted the feature/yaml-reader branch January 9, 2024 08:26
imbyungjun added a commit that referenced this pull request May 14, 2024
imbyungjun added a commit that referenced this pull request May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants