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

More ergonomic profile name handling #6157

Merged
merged 1 commit into from
Oct 27, 2022
Merged

Conversation

iknox-fa
Copy link
Contributor

@iknox-fa iknox-fa commented Oct 27, 2022

resolves #6156

Description

Allows for overriding the profile name when creating new runtime configs.
N.B. Per SB team we need to backport this to 1.2.

Checklist

@iknox-fa iknox-fa requested a review from a team as a code owner October 27, 2022 15:20
@iknox-fa iknox-fa requested a review from gshank October 27, 2022 15:20
@cla-bot cla-bot bot added the cla:yes label Oct 27, 2022
@github-actions
Copy link
Contributor

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

@iknox-fa iknox-fa added Skip Changelog Skips GHA to check for changelog file backport 1.2.latest This PR will be backported to the 1.2.latest branch labels Oct 27, 2022
@@ -3,31 +3,42 @@
from copy import deepcopy
from dataclasses import dataclass, field
from pathlib import Path
from typing import Dict, Any, Optional, Mapping, Iterator, Iterable, Tuple, List, MutableSet, Type
Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI-- Most of these import changes are just sorting... Nothing major changed here but having properly sorted imports matters so I'm doing a little cleanup whilst here.

@@ -190,28 +201,52 @@ def _get_rendered_profile(

@classmethod
def collect_parts(cls: Type["RuntimeConfig"], args: Any) -> Tuple[Project, Profile]:
Copy link
Contributor Author

@iknox-fa iknox-fa Oct 27, 2022

Choose a reason for hiding this comment

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

The code in this function will be basically what the SB team will use to generate the profile and project, which can then be used with the from_parts method to generate RuntimeConfigs using any valid profile name.

The difference will be potentially overriding the profile name when it's collected like so:

profile = cls.collect_profile(args=args, profile_name="a_valid_profile_name")

@leahwicz
Copy link
Contributor

@iknox-fa will this need to go into 1.3 as well then? Do we see any risk or breaking change with this going into a patch? (still catching up on this in Slack...)

Copy link
Contributor

@ChenyuLInx ChenyuLInx left a comment

Choose a reason for hiding this comment

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

LGTM

@ChenyuLInx
Copy link
Contributor

@iknox-fa will this need to go into 1.3 as well then? Do we see any risk or breaking change with this going into a patch? (still catching up on this in Slack...)

@leahwicz this won't be a breaking change.

@iknox-fa
Copy link
Contributor Author

iknox-fa commented Oct 27, 2022

@iknox-fa will this need to go into 1.3 as well then? Do we see any risk or breaking change with this going into a patch? (still catching up on this in Slack...)

Yep-- apparently they support 1.2+ so we'll ned this change in both. Do I need anotherPR for that? (I forget how our backport system works.. I haven't had to use it in ages).

Nevermind, I found the docs on how it works. :)

@iknox-fa iknox-fa merged commit 77dfec7 into main Oct 27, 2022
@iknox-fa iknox-fa deleted the iknox/easier-profile-naming branch October 27, 2022 15:49
@iknox-fa iknox-fa added backport 1.2.latest This PR will be backported to the 1.2.latest branch and removed backport 1.2.latest This PR will be backported to the 1.2.latest branch labels Oct 27, 2022
github-actions bot pushed a commit that referenced this pull request Oct 27, 2022
github-actions bot pushed a commit that referenced this pull request Nov 2, 2022
ChenyuLInx pushed a commit that referenced this pull request Nov 4, 2022
(cherry picked from commit 77dfec7)

Co-authored-by: Ian Knox <81931810+iknox-fa@users.noreply.github.com>
Co-authored-by: leahwicz <60146280+leahwicz@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.2.latest This PR will be backported to the 1.2.latest branch backport 1.3.latest cla:yes Skip Changelog Skips GHA to check for changelog file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CT-1426] Easier programmatic profile selection
3 participants