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

Port detection Optimization for Go Projects #38

Merged
merged 20 commits into from
Dec 19, 2023

Conversation

Jdubrick
Copy link
Contributor

@Jdubrick Jdubrick commented Dec 7, 2023

What does this PR do?

This PR improves the port detection process for Alizer, specifically for Go projects. Testing these changes against https://github.com/stackrox/stackrox resulted in a runtime speed increase of 50%. Within the PR the Go language has any file suffix with _test.go excluded from it's results, as well as adding mocks and migrations to a list of excluded folders. This results in less files being required to search through.

Which issue(s) does this PR fix

resolves devfile/api#1337

PR acceptance criteria

  • Unit/Functional tests

  • Documentation

How to test changes / Special notes to the reviewer

Testing the speed of these changes can be done by importing the recognizer into a separate Go project and tracking the runtime. Unit tests have been added for the changes and can be viewed as part of make test.

Issues Opened

Since the scope of this issue was primarily targeting Go, I have opened devfile/api#1376 to further the optimizations for all languages.

Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Copy link

codecov bot commented Dec 7, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (393ca66) 73.12% compared to head (7ea01ac) 73.16%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #38      +/-   ##
==========================================
+ Coverage   73.12%   73.16%   +0.03%     
==========================================
  Files          11       11              
  Lines        1563     1565       +2     
==========================================
+ Hits         1143     1145       +2     
  Misses        351      351              
  Partials       69       69              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@thepetk thepetk left a comment

Choose a reason for hiding this comment

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

In general it looks good to me. Left a minor suggestion and a comment :)

docs/proposals/port_detection_optimizations.md Outdated Show resolved Hide resolved
pkg/utils/detector.go Show resolved Hide resolved
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
@thepetk thepetk self-requested a review December 8, 2023 20:48
Copy link
Contributor

@thepetk thepetk left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Dec 8, 2023
Copy link

openshift-ci bot commented Dec 8, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Jdubrick, thepetk

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
@openshift-ci openshift-ci bot removed the lgtm label Dec 18, 2023
Copy link

openshift-ci bot commented Dec 18, 2023

New changes are detected. LGTM label has been removed.

Copy link
Member

@michael-valdron michael-valdron left a comment

Choose a reason for hiding this comment

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

Changes look good!

Few minor requests before merging:

  • Code needs rebase
  • Since this PR targets port detection optimizations for go projects, I'd rename it to "Port detection optimization for Go projects"

@Jdubrick Jdubrick changed the title Port detection optimization Port detection Optimization for Go Projects Dec 19, 2023
@Jdubrick Jdubrick merged commit 8f277a2 into devfile:main Dec 19, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Further optimizations on alizer's port detection process
4 participants