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

add fixKeys command / CSCLSROZ-29 #38

Closed
SabrinaEspino opened this issue May 5, 2021 · 8 comments · Fixed by #1022 or #1023
Closed

add fixKeys command / CSCLSROZ-29 #38

SabrinaEspino opened this issue May 5, 2021 · 8 comments · Fixed by #1022 or #1023
Assignees
Labels
c/Generic e/Core EPIC enhancement New feature or request; requires increasing the minor version of mcdev. Jira issue-type "Story" good first issue Good for newcomers PRIORITY used for professional service clients
Milestone

Comments

@SabrinaEspino
Copy link

SabrinaEspino commented May 5, 2021

add fixKeys command that re-uses the --changeKeyField logic together with this.definition.nameField

this is a basic wrapper around --changeKeyField that searches for metadata of the given type with name/key mismatches.

Acceptance Criteria:

  • types that cannot be used with this method are identified by:
    • use id as key (this.definition.keyField === this.definition.idField)
    • use the same field for name and key (this.definition.keyField === this.definition.nameField)
  • this command should search offline --> do a full retrieve of the BU first before executing the actual find logic.
  • after the key-change we need to then iterate over the definition/*.definition.js files to check for types that are dependent on the type you just fixed the keys for

out of scope:

basic steps:

  1. retrieve selected type
  2. find items with key != name (metadata[(this.definition.keyField] !== metadata[(this.definition.nameField])
  3. run deploy cred/bu type --fromRetrieve --changeKeyField=${this.definition.nameField} on found keys for selected type
  4. iterate over elements in lib\MetadataTypeDefinitions.js to check array in x.definition.dependencies for matches with the selected type
    • do notice that there are sometimes subtypes defined here as well, eg. "asset-message" --> if you applied fixKeys to "asset" then this would be a match
    • run full retrieve on types that have our selected type as a dependency to ensure that we have keys properly updated in our local folder

... the user then has to git add / commit & push on their own.

@SabrinaEspino SabrinaEspino added enhancement New feature or request; requires increasing the minor version of mcdev. Jira issue-type "Story" e/Core EPIC c/Generic labels May 5, 2021
@SabrinaEspino SabrinaEspino added this to the 3.2.0 milestone May 5, 2021
@JoernBerkefeld JoernBerkefeld modified the milestones: 3.2.0, 3.3.0, 3.4.0 Feb 21, 2022
@JoernBerkefeld JoernBerkefeld modified the milestones: 5.6.0 , 5.2.0 Jun 7, 2023
@JoernBerkefeld JoernBerkefeld changed the title Allow Upserts on Name / fixKeys command / CSCLSROZ-29 add fixKeys command / CSCLSROZ-29 Jun 7, 2023
@JoernBerkefeld JoernBerkefeld added the good first issue Good for newcomers label Jun 7, 2023
@JoernBerkefeld
Copy link
Contributor

@phjulia - maybe interesting for you?

@phjulia phjulia self-assigned this Jun 8, 2023
@phjulia
Copy link
Collaborator

phjulia commented Jun 18, 2023

@JoernBerkefeld
so basically mcdev fixKeys Project/BU type key? changeKeyField should be by default name? key and type are optional, but BU name is a required parameter

#1
mcdev fixKeys Project/BU type key

#2
mcdev fixKeys Project/BU type 

#3
mcdev fixKeys Project/BU

(3) would update the key to match the name in of all metadata of all types (where key can be updated)

@JoernBerkefeld
Copy link
Contributor

JoernBerkefeld commented Jun 18, 2023

Took the liberty of adding some formatting to your Post ;-)

Yes, in principle like that. Without type (=for all types), things might become problematic due to interdependencies.
To avoid needing to handle those, it might make sense to make type required.

Also, we should probably enforce a full retrieve of the chose type as a first part of what fixKeys does.

@JoernBerkefeld JoernBerkefeld added the PRIORITY used for professional service clients label Jun 28, 2023
phjulia added a commit that referenced this issue Jul 5, 2023
phjulia added a commit that referenced this issue Jul 10, 2023
@phjulia phjulia linked a pull request Jul 10, 2023 that will close this issue
4 tasks
phjulia added a commit that referenced this issue Jul 11, 2023
phjulia added a commit that referenced this issue Jul 11, 2023
phjulia added a commit that referenced this issue Jul 11, 2023
phjulia added a commit that referenced this issue Jul 11, 2023
@github-actions
Copy link

Closed by #1022.

@github-actions
Copy link

github-actions bot commented Aug 1, 2023

Closed by #1062.

@github-actions
Copy link

github-actions bot commented Aug 2, 2023

Closed by #1064.

JoernBerkefeld added a commit that referenced this issue Aug 3, 2023
should work just by allowing the 2 options because fixKeys uses deploy method internally
JoernBerkefeld added a commit that referenced this issue Aug 3, 2023
JoernBerkefeld added a commit that referenced this issue Aug 3, 2023
JoernBerkefeld added a commit that referenced this issue Aug 8, 2023
@github-actions
Copy link

github-actions bot commented Aug 8, 2023

Closed by #1067.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/Generic e/Core EPIC enhancement New feature or request; requires increasing the minor version of mcdev. Jira issue-type "Story" good first issue Good for newcomers PRIORITY used for professional service clients
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants