Skip to content

[Bug] Fix CI linter errors#885

Merged
okdas merged 12 commits intomainfrom
linter_fixes
Jul 10, 2023
Merged

[Bug] Fix CI linter errors#885
okdas merged 12 commits intomainfrom
linter_fixes

Conversation

@Olshansk
Copy link
Copy Markdown
Collaborator

@Olshansk Olshansk commented Jul 5, 2023

Description

Summary generated by Reviewpad on 10 Jul 23 23:40 UTC

This pull request includes the following changes:

  • Added a new file .github/workflows/golangci-lint.yml for golangci-lint workflow.
  • Modified the .github/workflows/main.yml file by removing the golangci-lint job.
  • Updated the .golangci.yml file to remove the typecheck linter.
  • Updated the Makefile to add installation of helm and tilt as part of install_cli_deps task.
  • Modified the app/client/cli/consensus.go file by adding an import statement.
  • Modified the p2p/config/config.go file to return an error in the IsValid() method.
  • Modified the p2p/raintree/router.go file by removing the unused import and variable.

Overall, this pull request adds a new golangci-lint workflow, updates some workflow files, makes changes to the Makefile, and modifies a few Go files.

Origin Document

I merged something unrelated to main and saw that the CI was broken

https://github.com/pokt-network/pocket/actions/runs/5468898070

Screenshot 2023-07-05 at 3 46 15 PM

Type of change

Please mark the relevant option(s):

  • New feature, functionality or library
  • Bug fix
  • Code health or cleanup
  • Major breaking change
  • Documentation
  • Other

List of changes

  • Fix linter errors on main
  • Make the linter run on branches as a separate workflow

Testing

  • make develop_test; if any code changes were made
  • make test_e2e on k8s LocalNet; if any code changes were made
  • e2e-devnet-test passes tests on DevNet; if any code was changed
  • Docker Compose LocalNet; if any major functionality was changed or introduced
  • k8s LocalNet; if any infrastructure or configuration changes were made

@Olshansk Olshansk added the bug Something isn't working - expected behaviour is incorrect label Jul 5, 2023
@Olshansk Olshansk requested a review from okdas July 5, 2023 22:47
@Olshansk Olshansk self-assigned this Jul 5, 2023
@reviewpad reviewpad bot added small Pull request is small waiting-for-review labels Jul 5, 2023
@okdas
Copy link
Copy Markdown
Contributor

okdas commented Jul 5, 2023

Thanks @Olshansk! I opened a PR (#850) to fix this and had planned to return to it. However, I like your concept of employing a separate golangci-lint workflow.

The existing approach configures linter to run only against modified files, allowing some errors to slip through. If we constantly run the linter on the entire codebase (by setting only-new-issues to false), it'll be more effective. It also won't impact the CI times, as it runs in parallel without delaying the main build.

To avoid redundancy, let's remove the current linter step from the main pipeline and get rid of only-new-issues: true.

I can apply these changes to your branch if that's okay.

@Olshansk
Copy link
Copy Markdown
Collaborator Author

Olshansk commented Jul 5, 2023

I can apply these changes to your branch if that's okay.

Sgtm, go ahead!

@okdas
Copy link
Copy Markdown
Contributor

okdas commented Jul 6, 2023

@Olshansk with linter now checking the whole codebase, it found more issues. I'll investigate them tomorrow.

@dylanlott dylanlott changed the title [Bug] Fix CI litner errors [Bug] Fix CI linter errors Jul 6, 2023
@Olshansk
Copy link
Copy Markdown
Collaborator Author

Olshansk commented Jul 6, 2023

@Olshansk with linter now checking the whole codebase, it found more issues. I'll investigate them tomorrow.

@okdas Have you had a chance to look into this?

@okdas
Copy link
Copy Markdown
Contributor

okdas commented Jul 6, 2023

@okdas Have you had a chance to look into this?

Yes, I'm working on this now. I wasn't able to reproduce locally, though, and have some ideas as of why this is happening.

@okdas
Copy link
Copy Markdown
Contributor

okdas commented Jul 7, 2023

@Olshansk Here's what's happening. The new CI job only pulls the source code, which doesn't include any code-generated stuff. As a result, we got a bunch of typecheck errors. I've added the necessary dependencies for that CI job, and it now comes back green.

I tried to remove the typecheck linter because it is redundant anyway (it does the same check the Go compiler performs during compilation), but there is no way to disable it via config, and some CLI voodoo is required.

At this point, I think it should be good to go (GTG). I've approved the PR; please merge if you are okay with my changes.

@okdas okdas merged commit e09f32a into main Jul 10, 2023
@okdas okdas deleted the linter_fixes branch July 10, 2023 23:46
bryanchriswhite added a commit that referenced this pull request Jul 11, 2023
* pokt/main:
  [P2P] Integrate background router (#732)
  Update main README.md
  [Bug] Fix CI linter errors (#885)
  [Tooling] Block `IN_THIS_*` comments from passing CI (#889)
bryanchriswhite added a commit that referenced this pull request Jul 11, 2023
* pokt/main:
  [P2P] Integrate background router (#732)
  Update main README.md
  [Bug] Fix CI linter errors (#885)
  [Tooling] Block `IN_THIS_*` comments from passing CI (#889)
  [Utility] Update E2E feature path template doc (#870)
  [IBC] Add nil check on proof for membership and non-membership proof creation (#877)
  Added git diff state to devlog10
  Devlog 10 (#872)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working - expected behaviour is incorrect small Pull request is small waiting-for-review

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants