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: refactor repository layout #1554

Merged
merged 1 commit into from
Feb 15, 2023
Merged

chore: refactor repository layout #1554

merged 1 commit into from
Feb 15, 2023

Conversation

zroubalik
Copy link
Contributor

@zroubalik zroubalik commented Feb 14, 2023

Signed-off-by: Zbynek Roubalik zroubalik@gmail.com

I'd prefer if we can merge this PR asap, rebasing this will be very painful :))

Moved majority of code into pkg. This is the layout now:

$ tree -L 2 -d 
.
├── bin
├── cmd
│   ├── func
│   ├── templates
│   └── testdata
├── docs
│   ├── building-functions
│   ├── function-templates
│   ├── generator
│   ├── language-packs
│   └── reference
├── generate
│   └── templates
├── hack
├── pkg
│   ├── builders
│   ├── config
│   ├── docker
│   ├── filesystem
│   ├── function
│   ├── http
│   ├── k8s
│   ├── knative
│   ├── mock
│   ├── openshift
│   ├── pipelines
│   ├── progress
│   ├── ssh
│   ├── testing
│   └── utils
├── plugin
├── schema
│   └── generator
├── templates
│   ├── go
│   ├── node
│   ├── python
│   ├── quarkus
│   ├── rust
│   ├── springboot
│   └── typescript
├── test
│   ├── common
│   ├── e2e
│   └── oncluster
├── third_party
│   └── VENDOR-LICENSE
└── vendor

Changes

  • 🧹 refactor repository layout

Fixes: #1547

@knative-prow knative-prow bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Feb 14, 2023
@zroubalik zroubalik closed this Feb 14, 2023
@knative-prow knative-prow bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 14, 2023
@zroubalik zroubalik reopened this Feb 14, 2023
@knative-prow knative-prow bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 14, 2023
@zroubalik zroubalik closed this Feb 14, 2023
@zroubalik zroubalik reopened this Feb 14, 2023
@codecov
Copy link

codecov bot commented Feb 14, 2023

Codecov Report

Base: 60.87% // Head: 60.64% // Decreases project coverage by -0.23% ⚠️

Coverage data is based on head (5e5a1a3) compared to base (e6618c0).
Patch coverage: 77.50% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1554      +/-   ##
==========================================
- Coverage   60.87%   60.64%   -0.23%     
==========================================
  Files          73       76       +3     
  Lines       10150    10216      +66     
==========================================
+ Hits         6179     6196      +17     
- Misses       3399     3453      +54     
+ Partials      572      567       -5     
Flag Coverage Δ
integration-tests 50.93% <61.53%> (-0.45%) ⬇️
unit-tests ?
unit-tests-macos-latest 49.40% <77.50%> (?)
unit-tests-ubuntu-latest 50.90% <77.50%> (?)
unit-tests-windows-latest 49.27% <65.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cmd/build.go 72.10% <ø> (ø)
cmd/client.go 83.95% <ø> (ø)
cmd/completion_util.go 0.00% <ø> (ø)
cmd/config.go 30.18% <ø> (ø)
cmd/config_envs.go 25.40% <ø> (ø)
cmd/config_labels.go 73.03% <ø> (ø)
cmd/config_volumes.go 25.13% <ø> (ø)
cmd/create.go 46.96% <ø> (ø)
cmd/delete.go 64.10% <ø> (ø)
cmd/deploy.go 68.45% <ø> (ø)
... and 69 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@zroubalik zroubalik marked this pull request as ready for review February 14, 2023 21:49
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 14, 2023
@zroubalik zroubalik requested review from lance, lkingland and matejvasek and removed request for maximilien February 14, 2023 21:50
@lkingland
Copy link
Member

lkingland commented Feb 15, 2023

I think the part I like about this the most is that, by default, we are back to there being a sane, Go-friendly default import path for users of the client library:

import knative.dev/func/pkg/function
...

function.XYZ

This is perhaps a bit pedantic, but since the singular makes it sound like they are expecting to operate on a single function, and the name is "Knative Functions", would it be better for the user if the package name were plural?

functions.NewFunction?
functions.XYZ?

Overall huge improvement. Yes' let's merge quickly to minimize collateral damage.

/lgtm
/hold for answer if anyone else thinks functions plural

@knative-prow knative-prow bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 15, 2023
@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Feb 15, 2023
@knative-prow knative-prow bot removed the lgtm Indicates that a PR is ready to be merged. label Feb 15, 2023
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Feb 15, 2023
@knative-prow
Copy link

knative-prow bot commented Feb 15, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lkingland, zroubalik

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:
  • OWNERS [lkingland,zroubalik]

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

@lkingland lkingland removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 15, 2023
@knative-prow knative-prow bot merged commit 5a4803b into knative:main Feb 15, 2023
lance pushed a commit to lance/func that referenced this pull request Feb 15, 2023
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
lance pushed a commit to lance/func that referenced this pull request Feb 15, 2023
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
knative-prow bot pushed a commit that referenced this pull request Feb 16, 2023
* add option 'branch' to command 'repository add'

* Format go code (#1407)

Signed-off-by: Knative Automation <automation@knative.team>

* chore: refactor repository layout (#1554)

Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>

* fixup: removes --branch tag from repo commands

Removes the currently in-flight work on the `--branch` tag, simply
supporting a `refspec` on the repository URI. For example,
https://github.com/knative-sandbox/func-tastic#metacontroller will pull
the `func-tastic` repo, and set the currently active HEAD to the
`metacontroller` branch. Adds support for displaying this with the
command `func repo list -v`.

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: add example to `func repo add` documentation

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: adjust test output expectations

Signed-off-by: Lance Ball <lball@redhat.com>

---------

Signed-off-by: Knative Automation <automation@knative.team>
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
Signed-off-by: Lance Ball <lball@redhat.com>
Co-authored-by: Yingchun Guo <yingchun.guo@intel.com>
Co-authored-by: knative-automation <automation@knative.team>
Co-authored-by: Zbynek Roubalik <zroubalik@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor repository layout - make it more hierarchical
2 participants