Skip to content

Add task config in the flytectl config file - #6538

Merged
pingsutw merged 5 commits into
flyteorg:masterfrom
arbaobao:add_task_config
Aug 17, 2025
Merged

Add task config in the flytectl config file#6538
pingsutw merged 5 commits into
flyteorg:masterfrom
arbaobao:add_task_config

Conversation

@arbaobao

@arbaobao arbaobao commented Jul 22, 2025

Copy link
Copy Markdown
Contributor

Tracking issue

Why are the changes needed?

If we specified the project/domain in the flytectl config, we don't need to add -p flytesnack -d deployment in every flytectl command.

What changes were proposed in this pull request?

Read the flytectl config when there aren't project/domain in the flytectl config.

How was this patch tested?

Run flytectl command without specifying project/domain

flytectl get workflow

Before:

Screenshot 2025-07-23 at 12 44 13 AM

After:

Add task config in flytectl config and Run flytectl command
Screenshot 2025-07-23 at 12 47 09 AM

Screenshot 2025-07-23 at 12 46 40 AM

Setup process

Screenshots

Screenshot 2025-07-23 at 12 52 26 AM Screenshot 2025-07-23 at 12 52 44 AM

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

Summary by Bito

This pull request introduces a new task configuration feature in the flytectl tool, enabling users to set project and domain settings in the configuration file. This enhancement streamlines command usage and minimizes the need for repetitive command-line inputs, improving the overall user experience. It includes the addition of a TaskConfig struct and updates to command handling, as well as modifications to the GetConfig function to read these values from the configuration when not explicitly provided.

@codecov

codecov Bot commented Jul 22, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.69%. Comparing base (66ea07d) to head (0f860c8).
⚠️ Report is 12 commits behind head on master.

Files with missing lines Patch % Lines
flytectl/cmd/config/config.go 0.00% 8 Missing ⚠️
flytectl/cmd/core/cmd.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6538      +/-   ##
==========================================
+ Coverage   58.64%   58.69%   +0.05%     
==========================================
  Files         938      938              
  Lines       71527    71705     +178     
==========================================
+ Hits        41948    42090     +142     
- Misses      26390    26423      +33     
- Partials     3189     3192       +3     
Flag Coverage Δ
unittests-datacatalog 59.03% <ø> (ø)
unittests-flyteadmin 56.12% <ø> (+<0.01%) ⬆️
unittests-flytecopilot 39.56% <ø> (ø)
unittests-flytectl 64.71% <0.00%> (-0.02%) ⬇️
unittests-flyteidl 76.12% <ø> (ø)
unittests-flyteplugins 61.14% <ø> (ø)
unittests-flytepropeller 55.06% <ø> (+0.21%) ⬆️
unittests-flytestdlib 64.06% <ø> (+0.02%) ⬆️

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

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread flytectl/pkg/configutil/configutil.go Outdated
Comment thread flytectl/cmd/config/config.go Outdated
Comment thread flytectl/cmd/core/cmd.go Outdated
Comment thread flytectl/cmd/core/cmd.go
Signed-off-by: Nelson Chen <asd3431090@gmail.com>
@machichima

machichima commented Jul 24, 2025

Copy link
Copy Markdown
Member

I think the field name task is a bit ambiguous for content like "project", "domain", and "org". Also, we should clarify that this field is only used when working with flytectl. Would it make sense to rename it to something like flytectl_context / flytectl_task_context (or suggest a better name)?

cc @pingsutw WDYT?

@pingsutw

Copy link
Copy Markdown
Member

I think the field name task is a bit ambiguous for content like "project", "domain", and "org".

It's intentional, we want to make it consistent with Flyte SDK

@kumare3

kumare3 commented Aug 14, 2025

Copy link
Copy Markdown
Contributor

I agree the field name is not great, but we have shopped in v2

machichima
machichima previously approved these changes Aug 15, 2025

@machichima machichima left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thank you!

Comment thread flytectl/cmd/config/config.go Outdated
Signed-off-by: Nelson Chen <asd3431090@gmail.com>
@pingsutw
pingsutw merged commit 077a3d7 into flyteorg:master Aug 17, 2025
50 checks passed
Comment thread flytectl/cmd/core/cmd.go
if config.GetConfig().Domain == "" {
return fmt.Errorf("project and domain are required parameters")
}
fmt.Printf("Using Project: %s, Domain: %s\n", config.GetConfig().Project, config.GetConfig().Domain)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This print out seems to break json output. I think it should either be reverted or silenced when outputting json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants