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

chore(deps): Upgrade gopkg.in/yaml to v3 #2868

Closed
wants to merge 11 commits into from
Closed

chore(deps): Upgrade gopkg.in/yaml to v3 #2868

wants to merge 11 commits into from

Conversation

nitrocode
Copy link
Member

@nitrocode nitrocode commented Dec 23, 2022

what

  • Upgrade gopkg.in/yaml to v3 (may 2022)
  • Deprecate v2 (nov 2020)

why

  • Use latest and greatest

references

notes

  • From the related issues, this seems like a difficult and error-prone upgrade. I do not think it's worth it at this time since this may introduce other issues.
  • current errors are below
--- FAIL: TestPolicySetsConfig_YAMLMarshalling (0.00s)
    --- FAIL: TestPolicySetsConfig_YAMLMarshalling/valid_yaml (0.00s)
        policies_test.go:61: unexpected error: EOF
--- FAIL: TestProject_UnmarshalYAML (0.00s)
    --- FAIL: TestProject_UnmarshalYAML/omit_unset_fields (0.00s)
        project_test.go:81: unexpected error: EOF
--- FAIL: TestConfig_UnmarshalYAML (0.00s)
    --- FAIL: TestConfig_UnmarshalYAML/no_data (0.00s)
        repo_cfg_test.go:197: unexpected error: EOF
--- FAIL: TestStage_UnmarshalYAML (0.00s)
    --- FAIL: TestStage_UnmarshalYAML/empty (0.00s)
        stage_test.go:48: unexpected error: EOF
--- FAIL: TestStepConfig_YAMLMarshalling (0.00s)
    --- FAIL: TestStepConfig_YAMLMarshalling/single_string (0.00s)
        step_test.go:174: unexpected error: EOF
    --- FAIL: TestStepConfig_YAMLMarshalling/extra_args_style (0.00s)
        step_test.go:174: unexpected error: EOF
    --- FAIL: TestStepConfig_YAMLMarshalling/extra_args_style_multiple_keys (0.00s)
        step_test.go:174: unexpected error: EOF
    --- FAIL: TestStepConfig_YAMLMarshalling/extra_args_style_multiple_top-level_keys (0.00s)
        step_test.go:174: unexpected error: EOF
    --- FAIL: TestStepConfig_YAMLMarshalling/env_step_value (0.00s)
        step_test.go:174: unexpected error: EOF
    --- FAIL: TestStepConfig_YAMLMarshalling/env_step_command (0.00s)
        step_test.go:174: unexpected error: EOF
    --- FAIL: TestStepConfig_YAMLMarshalling/run_step (0.00s)
        step_test.go:174: unexpected error: EOF
    --- FAIL: TestStepConfig_YAMLMarshalling/run_step_multiple_top-level_keys (0.00s)
        step_test.go:174: unexpected error: EOF
    --- FAIL: TestStepConfig_YAMLMarshalling/empty (0.00s)
        step_test.go:166: unexpected error: EOF
--- FAIL: TestWorkflowHook_YAMLMarshalling (0.00s)
    --- FAIL: TestWorkflowHook_YAMLMarshalling/run_step (0.00s)
        workflow_step_test.go:73: unexpected error: EOF
    --- FAIL: TestWorkflowHook_YAMLMarshalling/run_step_multiple_top-level_keys (0.00s)
        workflow_step_test.go:73: unexpected error: EOF
--- FAIL: TestWorkflow_UnmarshalYAML (0.00s)
    --- FAIL: TestWorkflow_UnmarshalYAML/empty (0.00s)
        workflow_test.go:117: unexpected error: EOF

@nitrocode nitrocode requested a review from a team as a code owner December 23, 2022 17:48
@nitrocode nitrocode marked this pull request as draft December 23, 2022 17:50
@nitrocode
Copy link
Member Author

Looks like this is breaking tests so additional fixes will have to be put in to ensure this doesn't break anything.

@nitrocode
Copy link
Member Author

@krrrr38 From the related issues, this seems like a difficult and error-prone upgrade. I do not think it's worth it at this time since this may introduce other issues.

Interested in your thoughts here.

@nitrocode nitrocode added this to the 0.22.1 milestone Dec 23, 2022
@krrrr38
Copy link
Contributor

krrrr38 commented Dec 23, 2022

There are many changes from v2 to v3 upgrading https://ubuntu.com/blog/api-v3-of-the-yaml-package-for-go-is-available. v2.4.0 is 2years old lib, so it is better to upgrade in the not so far future.

No needed to upgrade urgently. So, how about to upgrade go-yaml v3 in the atlantis v0.23.0 or 0.22.1? After releasing 0.22.0, we will soon merge go-yaml v3 to provide dev/pre-release image to users for checking behaviour.

@nitrocode
Copy link
Member Author

@krrrr38 feel free to try the upgrade. I may be using the new library incorrectly. From the issues in the upstream library, I'm hesitant to upgrade because there are a lot of v3 bugs so I figured this migration may give us a higher ROI once v3 is more stable. The bugs keep getting written and the commits have unfortunately stalled in that repo...

@jamengual jamengual added the dependencies PRs that update a dependency file label Dec 29, 2022
@nitrocode nitrocode modified the milestones: 0.22.2, 0.22.3, 0.23.0 Jan 6, 2023
@nitrocode nitrocode marked this pull request as ready for review January 24, 2023 05:50
@github-actions github-actions bot added the go Pull requests that update Go code label Jan 24, 2023
@nitrocode nitrocode modified the milestones: v0.23.0, v0.24.0 Jan 30, 2023
@nitrocode nitrocode marked this pull request as draft January 30, 2023 12:56
@nitrocode nitrocode marked this pull request as ready for review March 26, 2023 15:45
@nitrocode
Copy link
Member Author

Tests are magically passing due to a paths bug triggering the no op action

@GenPage GenPage modified the milestones: v0.24.0, v0.25.0 May 15, 2023
@GenPage
Copy link
Member

GenPage commented May 15, 2023

I've been digging into the test failures, it seems to be related to how v3 now handles null values

@jamengual
Copy link
Contributor

@nitrocode do you think you will have time to finish this?

@jamengual
Copy link
Contributor

@nitrocode is this still relevant?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies PRs that update a dependency file go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants