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

Implement "sync" feature for languages #26002

Closed
Tracked by #24354
nollymar opened this issue Sep 6, 2023 · 5 comments · Fixed by #26239
Closed
Tracked by #24354

Implement "sync" feature for languages #26002

nollymar opened this issue Sep 6, 2023 · 5 comments · Fixed by #26239

Comments

@nollymar
Copy link
Contributor

nollymar commented Sep 6, 2023

No description provided.

@nollymar nollymar moved this from New to Current Sprint Backlog in dotCMS - Product Planning Sep 6, 2023
@jgambarios jgambarios moved this from Current Sprint Backlog to In Progress in dotCMS - Product Planning Sep 12, 2023
@jgambarios jgambarios self-assigned this Sep 12, 2023
jgambarios added a commit that referenced this issue Sep 20, 2023
Incorporated a new feature in 'PushServiceImpl' and 'FormatStatus' to allow ignoring results with no action during push operation. If 'dryRun' is set in 'PushServiceImpl', the new optional 'ignoreNoAction' parameter would be taken into account while formatting the push analysis results. This enhancement caters for more efficient resource utilization as results with no action (NO_ACTION) are filtered out before the formatting operation.
jgambarios added a commit that referenced this issue Sep 21, 2023
Created two methods in MapperService which will provide an instance of ObjectMapper based on the format of the input file. One for specific file and another one for the general process. Also made changes to how languages are pushed in LanguagePush class.
jgambarios added a commit that referenced this issue Sep 21, 2023
jgambarios added a commit that referenced this issue Sep 21, 2023
Added a function in MapperService to prepare ObjectMapper based on the provided input/output format. This change handles creation of ObjectMapper when it is required to be created based on the specific Input/Output format. This enhances flexibility and improves handling of different file formats. By default, it returns ObjectMapper for YAML format. Also optimized FormatOptionMixin and enhanced test coverage.
jgambarios added a commit that referenced this issue Sep 21, 2023
Updated the `LanguageComparator` class to improve the efficiency of finding matching language content. The comparison now happens firstly by id and then, if no match is found, by ISO code. This change provides a faster and more precise match. Also, added two separate private methods, `findById` and `findByISOCode`, to handle these comparisons. Revised tests accordingly and added a new test case for updated languages.
@jgambarios jgambarios linked a pull request Sep 22, 2023 that will close this issue
@nollymar nollymar moved this from In Progress to In Review in dotCMS - Product Planning Sep 25, 2023
jgambarios added a commit that referenced this issue Sep 25, 2023
jgambarios added a commit that referenced this issue Sep 25, 2023
@github-project-automation github-project-automation bot moved this from In Review to Done in dotCMS - Product Planning Sep 25, 2023
@nollymar nollymar reopened this Sep 25, 2023
@github-project-automation github-project-automation bot moved this from Done to Current Sprint Backlog in dotCMS - Product Planning Sep 25, 2023
@nollymar nollymar moved this from Current Sprint Backlog to Internal QA in dotCMS - Product Planning Sep 25, 2023
@jgambarios
Copy link
Contributor

Note for QA:

What to test: The functionality to call the language push command for a folder inside a valid CLI workspace or for a specific language file is now available.

1. If "push" is called for a specific file, for example:

lang push <workspace-path>/languages/es-es.json

The CLI will determine whether it's a new language that should be created on the server, if it needs updating, or if no changes are detected and nothing will be done.

To determine the specific operation "push" will execute, you can run the command with the --dry-run flag.

lang push <workspace-path>/languages/es-es.json --dry-run

2. If "push" is called for a folder:

lang push <workspace-path>

The specified folder must be at the root or inside a valid CLI workspace, and it will push the files located inside the /languages/ folder.

The CLI will decide for each language file whether it's a new language that should be created on the server, if it needs updating, or if no changes are detected and nothing will be done.

To determine the specific operation "push" will execute, you can run the command with the --dry-run flag.

lang push <workspace-path> --dry-run

Additionally, you can pass the --removeLanguages flag, and the CLI will compare the local language files against the server languages to decide if any languages need to be deleted on the server. In other words, if a language exists on the server but not in the list of language files, the CLI will delete that language.

lang push <workspace-path> --removeLanguages --dry-run

I highly recommend using the --dry-run option as it is very useful for understanding the actions the CLI will attempt without making changes to the server.

@github-project-automation github-project-automation bot moved this from Internal QA to Done in dotCMS - Product Planning Nov 13, 2023
@nollymar nollymar moved this from Done to Internal QA in dotCMS - Product Planning Nov 13, 2023
@nollymar nollymar moved this from Internal QA to QA - Backlog in dotCMS - Product Planning Nov 17, 2023
@bryanboza bryanboza moved this from QA - Backlog to QA - In Progress in dotCMS - Product Planning Nov 20, 2023
@bryanboza bryanboza moved this from QA - In Progress to QA - Backlog in dotCMS - Product Planning Nov 20, 2023
@bryanboza
Copy link
Contributor

We need work here:

We need to exclude the property isoCode as part of the json, this because when you create the lang from the admin console, we don't need to define this value, this is auto-calculated based in the provided parameter. Now when you push we need to provide this parameter and all the other ones are calculated based on the iso code.

Example:

  • If you send some language from some specific country, but in the isoCode you just send the language, we are ignoring the properties and we set the new language just calculating the parameters of the iso code.

  • Also, once that you set the parameters and try to push, we are losing the parameter if you don't send correctly the isoCode

Here the language portlet
Image

Here the lang.json

{
  "dotCMSObjectType" : "Language",
  "id" : 4963328,
  "languageCode" : "es",
  "countryCode" : "",
  "language" : "Spanish",
  "country" : "",
  "defaultLanguage" : false,
  "isoCode" : "es"
}

@bryanboza bryanboza moved this from QA - Backlog to QA - Rejected in dotCMS - Product Planning Jan 11, 2024
@nollymar
Copy link
Contributor Author

we need to discuss it with @wezell , as the isoCode is the only property required to create a language. The current behavior is part of the initial requirements

@bryanboza bryanboza added the Release : 24.01.26 Bug Fixing label Jan 18, 2024
@nollymar
Copy link
Contributor Author

After further discussion, we agreed that @bryanboza 's request will be implemented on this card

@bryanboza bryanboza added Release : 24.02.20 New binary field, AI plugin and removed Release : 24.01.26 Bug Fixing labels Jan 29, 2024
@nollymar nollymar moved this from QA - Rejected to QA - Backlog in dotCMS - Product Planning Feb 7, 2024
@bryanboza
Copy link
Contributor

We can close this card, the new request will be handled in a new card

@bryanboza bryanboza moved this from QA - Backlog to Done in dotCMS - Product Planning Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants