Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Added option to update labels & description in project #260

Merged
merged 19 commits into from
Jan 24, 2022
Merged

Conversation

yindia
Copy link
Contributor

@yindia yindia commented Jan 9, 2022

TL;DR

  • Added option to update labels & description in project
  • Refactor(Moved) project flag for update & create
  • Added Option to update project through file
  • Deprecated --activateProject --archiveProject to --activate --archive
  • Change the file formate for creating a project from

Test:

21:56:15 ➜ flytectl go run main.go create project  --id data --name data --description "Team that manage Data" --labels "team=eta,managedby=flyte"
project Created successfully
21:56:22 ➜ flytectl go run main.go get projects data -oyaml
description: Team that manage Data
domains:
- id: development
  name: development
- id: staging
  name: staging
- id: production
  name: production
id: data
labels:
  values:
    managedby: flyte
    team: eta
name: data

21:56:38 ➜ flytectl go run main.go update project  --id data --name datadata --description "Team that manage Data Platform" --labels "team=data,managedby=flyte"
Project data updated

21:57:40 ➜ flytectl go run main.go get projects datadata -oyaml
description: Team that manage Data Platform
domains:
- id: development
  name: development
- id: staging
  name: staging
- id: production
  name: production
id: data
labels:
  values:
    managedby: flyte
    team: data
name: datadata


21:58:13 ➜ flytectl go run main.go get projects
 --------------- --------------- --------------------------------
| ID (4)        | NAME          | DESCRIPTION                    |
 --------------- --------------- --------------------------------
| data          | datadata      | Team that manage Data Platform |
 --------------- --------------- --------------------------------
| flyteexamples | flyteexamples | flyteexamples description      |
 --------------- --------------- --------------------------------
| flytetester   | flytetester   | flytetester description        |
 --------------- --------------- --------------------------------
| flytesnacks   | flytesnacks   | flytesnacks description        |
 --------------- --------------- --------------------------------

22:00:03 ➜ flytectl go run main.go create project  --file project.yaml
project Created successfully
22:00:50 ➜ flytectl go run main.go get projects mlops -oyaml
description: flytectl feature test labels
domains:
- id: development
  name: development
- id: staging
  name: staging
- id: production
  name: production
id: mlops
labels:
  values:
    managed-by: flyte
    team: mlops
name: mlops


22:01:17 ➜ flytectl go run main.go update project  --file="project.yaml"
Project mlops updated
22:01:57 ➜ flytectl go run main.go get projects ops -oyaml
description: flytectl feature test labels for ops
domains:
- id: development
  name: development
- id: staging
  name: staging
- id: production
  name: production
id: mlops
labels:
  values:
    managed-by: ops
    team: mlops
name: ops


22:02:10 ➜ flytectl go run main.go update project  --file="project.yaml" --archiveProject
Project mlops updated
22:02:43 ➜ flytectl go run main.go get projects
 --------------- --------------- --------------------------------
| ID (4)        | NAME          | DESCRIPTION                    |
 --------------- --------------- --------------------------------
| data          | datadata      | Team that manage Data Platform |
 --------------- --------------- --------------------------------
| flyteexamples | flyteexamples | flyteexamples description      |
 --------------- --------------- --------------------------------
| flytetester   | flytetester   | flytetester description        |
 --------------- --------------- --------------------------------
| flytesnacks   | flytesnacks   | flytesnacks description        |
 --------------- --------------- --------------------------------


21:41:11 ➜ flytectl go run main.go update  project  --id eta  --archiveProject  --activateProject            
Error: Invalid state passed. Specify either activate or archive

exit status 1

22:04:26 ➜ flytectl go run main.go update project  --file="project.yaml" --activateProject
Project mlops updated

22:05:10 ➜ flytectl go run main.go get projects                                           
 --------------- --------------- -------------------------------------- 
| ID (5)        | NAME          | DESCRIPTION                          |
 --------------- --------------- -------------------------------------- 
| mlops         | ops           | flytectl feature test labels for ops |
 --------------- --------------- -------------------------------------- 
| data          | datadata      | Team that manage Data Platform       |
 --------------- --------------- -------------------------------------- 
| flyteexamples | flyteexamples | flyteexamples description            |
 --------------- --------------- -------------------------------------- 
| flytetester   | flytetester   | flytetester description              |
 --------------- --------------- -------------------------------------- 
| flytesnacks   | flytesnacks   | flytesnacks description              |
 --------------- --------------- -------------------------------------- 



19:33:55 ➜ flytectl go run main.go get project lyft -oyaml               
description: spotify feature test labels
domains:
- id: development
  name: development
- id: staging
  name: staging
- id: production
  name: production
id: lyft
labels:
  values:
    managed-by: spotify
    team: spotify
name: spotify

19:34:20 ➜ flytectl go run main.go get project lyft -oyaml > project.yaml
19:34:29 ➜ flytectl go run main.go update project --file project.yaml    
Project lyft updated
19:35:12 ➜ flytectl go run main.go get project lyft -oyaml               
description: Intel feature test labels
domains:
- id: development
  name: development
- id: staging
  name: staging
- id: production
  name: production
id: lyft
labels:
  values:
    managed-by: intel
    team: intel
name: intel

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

How did you fix the bug, make the feature etc. Link to any design docs etc

Tracking Issue

flyteorg/flyte#1873
flyteorg/flyte#1620

Follow-up issue

NA
OR
https://github.com/flyteorg/flyte/issues/

yindia added 3 commits January 9, 2022 18:48
Signed-off-by: Yuvraj <code@evalsocket.dev>
Signed-off-by: Yuvraj <code@evalsocket.dev>
Signed-off-by: Yuvraj <code@evalsocket.dev>
@yindia yindia marked this pull request as draft January 9, 2022 16:17
Signed-off-by: Yuvraj <code@evalsocket.dev>
@codecov
Copy link

codecov bot commented Jan 9, 2022

Codecov Report

Merging #260 (ed1b053) into master (ce1c5f4) will increase coverage by 4.08%.
The diff coverage is 75.02%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #260      +/-   ##
==========================================
+ Coverage   76.17%   80.26%   +4.08%     
==========================================
  Files         106       97       -9     
  Lines        2695     3516     +821     
==========================================
+ Hits         2053     2822     +769     
+ Misses        528      472      -56     
- Partials      114      222     +108     
Impacted Files Coverage Δ
cmd/completion.go 90.90% <ø> (ø)
cmd/config/config.go 66.66% <ø> (ø)
cmd/get/matchable_cluster_resource_attribute.go 100.00% <ø> (ø)
cmd/get/matchable_execution_cluster_label.go 100.00% <ø> (ø)
cmd/get/matchable_execution_queue_attribute.go 100.00% <ø> (ø)
cmd/get/matchable_plugin_override.go 100.00% <ø> (ø)
cmd/get/matchable_task_resource_attribute.go 100.00% <ø> (ø)
cmd/register/register.go 100.00% <ø> (ø)
cmd/sandbox/status.go 83.33% <ø> (+3.33%) ⬆️
cmd/update/task_meta.go 100.00% <ø> (ø)
... and 162 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e5e7b96...ed1b053. Read the comment docs.

yindia added 2 commits January 9, 2022 22:06
…bels

Signed-off-by: Yuvraj <code@evalsocket.dev>
Signed-off-by: Yuvraj <code@evalsocket.dev>
@yindia yindia marked this pull request as ready for review January 9, 2022 16:40
Signed-off-by: Yuvraj <code@evalsocket.dev>
@yindia yindia changed the title Feature/labels Added option to update labels & description in project Jan 9, 2022
yindia added 2 commits January 9, 2022 22:40
Signed-off-by: Yuvraj <code@evalsocket.dev>
Signed-off-by: Yuvraj <code@evalsocket.dev>
cmd/update/project.go Outdated Show resolved Hide resolved
cmd/update/project.go Outdated Show resolved Hide resolved
cmd/config/subcommand/project/project_config.go Outdated Show resolved Hide resolved
cmd/update/project.go Outdated Show resolved Hide resolved
cmd/update/project.go Outdated Show resolved Hide resolved
Signed-off-by: Yuvraj <code@evalsocket.dev>
Signed-off-by: Yuvraj <code@evalsocket.dev>
Signed-off-by: Yuvraj <code@evalsocket.dev>
Signed-off-by: Yuvraj <code@evalsocket.dev>
EngHabu
EngHabu previously approved these changes Jan 21, 2022
Copy link
Contributor

@EngHabu EngHabu left a comment

Choose a reason for hiding this comment

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

The change looks fine to me but it is considered a breaking change because we are removing flags that would work today... Ideally we only deprecate these flags and delete them in a future update... otherwise we should include breaking change notice in the release notes

pkg/util/util.go Outdated Show resolved Hide resolved
cmd/update/project.go Outdated Show resolved Hide resolved
Signed-off-by: Yuvraj <code@evalsocket.dev>
…ature/labels

Signed-off-by: Yuvraj <code@evalsocket.dev>
@yindia yindia dismissed stale reviews from pmahindrakar-oss and EngHabu via 32abab3 January 22, 2022 18:55
Signed-off-by: Yuvraj <code@evalsocket.dev>
@yindia yindia enabled auto-merge (squash) January 23, 2022 13:23
cmd/config/subcommand/project/project_config.go Outdated Show resolved Hide resolved
cmd/update/project.go Outdated Show resolved Hide resolved
Signed-off-by: Yuvraj <code@evalsocket.dev>
@yindia yindia disabled auto-merge January 24, 2022 05:46
Signed-off-by: Yuvraj <code@evalsocket.dev>
@yindia yindia merged commit 4159cd5 into master Jan 24, 2022
@yindia yindia deleted the feature/labels branch January 24, 2022 10:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants