corteza
corteza copied to clipboard
Refactor packages under pkg/ and remove all component importing.
Many packages under pkg/
still reference type packages from components.
This must be improved either by
- moving the whole package from pkg into a component (federation)
- moving package to the root (envoy, provision)
- refactoring with generics or interfaces (Corredor, envoy?)
packages with component imports:
(for cmp in compose system federation types; do grep -r '/types"' pkg|grep "${cmp}/types"; done) | sort | cut -d '/' -f 1,2| uniq
- [ ] pkg/apigw
- [ ] pkg/auth
- [x] pkg/codegen
- [ ] pkg/corredor
- [x] pkg/discovery
- [ ] pkg/federation
- [x] pkg/messagebus
- [ ] pkg/provision
- [x] pkg/seeder
Removed pkg/envoy; see my comment
Stale issue message
Apigw and messagebus: https://github.com/cortezaproject/corteza/tree/2023.3.x-feature-refactor-pkg
Ignore pkg/envoy
, it'll be removed and replaced with the new implementation when fully ported over
Spit the work between one another so that Vivek works max 2d on this
For now, skipping pkg/provision, pkg/corredor, pkg/auth(TBD either to move it to root or refactor inside pkg/auth).
Todo @vicpatel :
- Clarify a bit on why we're skipping the above packages, problems, solutions, ...
- Consider updating this issue (re-open and move to some backlog), OR open new issue(s) for the new bits.
Additional work (refactoring the packages to be moved to the root (or similar) should be discussed with the rest of the (BE) devs.
---- pkg/auth
-- server/pkg/auth/system.go
; there is use of system type, so we can move handlers to system types, instead of moving whole pkg.
- Why# It's been used mainly at boot level; It's good to have dedicate pkg/auth. Since It's bit complex to move it out of pkg bc it might force us to keep service intialization in dedicated order.
---- pkg/corredor
-- Again there is use of system/types, mostly for User struct; so we need have interfaces for user, to remove usage of system types from this pkg.
---- pkg/provision
-- There is use of compose and system types, so move it root or refactoring it(pkg/provision
) by having generic interfaces from both component(compose/system) as need to remove usage of component types.
We can use this issue for disscussion then either use this issue or have separate tasks.
Stale issue message