Skip to content

Commit

Permalink
Send packages to a full release
Browse files Browse the repository at this point in the history
Update deprecation messages and docs
  • Loading branch information
LandonTClipp committed Jun 27, 2023
1 parent 3f9cb26 commit 1e03433
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 47 deletions.
46 changes: 4 additions & 42 deletions cmd/mockery.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (

"github.com/chigopher/pathlib"
"github.com/mitchellh/go-homedir"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand Down Expand Up @@ -235,12 +234,6 @@ func (r *RootApp) Run() error {
if err != nil {
return fmt.Errorf("failed to get package from config: %w", err)
}
warnBeta(
ctx,
"use of the 'packages' config variable is currently in a beta state. Use at your own risk.",
map[string]any{
"discussion": "https://github.com/vektra/mockery/discussions/549",
})
parser := pkg.NewParser(buildTags)

if err := parser.ParsePackages(ctx, configuredPackages); err != nil {
Expand Down Expand Up @@ -283,6 +276,10 @@ func (r *RootApp) Run() error {
}
}
} else {
log.Warn().
Fields(map[string]any{"url": "https://vektra.github.io/mockery/features/#packages-configuration"}).
Msg("DEPRECATION: use of the legacy config semantics is deprecated and will be removed in v3. " + "Please use the packages feature in the provided URL.")

if r.Config.Name != "" && r.Config.All {
log.Fatal().Msgf("Specify --name or --all, but not both")
} else if (r.Config.FileName != "" || r.Config.StructName != "") && r.Config.All {
Expand All @@ -308,15 +305,6 @@ func (r *RootApp) Run() error {
log.Fatal().Msgf("Use --name to specify the name of the interface or --all for all interfaces found")
}

infoDiscussion(
ctx,
"dynamic walking of project is being considered for removal "+
"in v3. Please provide your feedback at the linked discussion.",
map[string]any{
"pr": "https://github.com/vektra/mockery/pull/548",
"discussion": "https://github.com/vektra/mockery/discussions/549",
})

if r.Config.Profile != "" {
f, err := os.Create(r.Config.Profile)
if err != nil {
Expand Down Expand Up @@ -401,29 +389,3 @@ func (r *RootApp) Run() error {

return nil
}

func warn(ctx context.Context, prefix string, message string, fields map[string]any) {
log := zerolog.Ctx(ctx)
event := log.Warn()
if fields != nil {
event = event.Fields(fields)
}
event.Msgf("%s: %s", prefix, message)
}

func info(ctx context.Context, prefix string, message string, fields map[string]any) {
log := zerolog.Ctx(ctx)
event := log.Info()
if fields != nil {
event = event.Fields(fields)
}
event.Msgf("%s: %s", prefix, message)
}

func infoDiscussion(ctx context.Context, message string, fields map[string]any) {
info(ctx, "DISCUSSION", message, fields)
}

func warnBeta(ctx context.Context, message string, fields map[string]any) {
warn(ctx, "BETA FEATURE", message, fields)
}
5 changes: 1 addition & 4 deletions docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,7 @@ func (_m *Handler) HandleMessage(m pubsub.Message) error {

`packages` configuration
------------------------
:octicons-tag-24: v2.21.0 · :material-test-tube: Beta Feature

!!! warning
This feature is considered beta. The feature set has been solidifed, but we are asking users to beta-test for any bugs. Use at your own risk. This warning will be updated as this feature matures.
:octicons-tag-24: v2.31.0

!!! info
See the [Migration Docs](/mockery/migrating_to_packages/) on how to migrate to this new feature.
Expand Down
3 changes: 2 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cairosvg
mike
mkdocs
mkdocs-glightbox
mkdocs-material
mkdocs-open-in-new-tab
cairosvg
pillow

0 comments on commit 1e03433

Please sign in to comment.