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

feat: add a new command to filter the content of Profile and Pset based on multiple package.xml #90

Closed
wants to merge 7 commits into from

Conversation

scolladon
Copy link
Owner

What does this pull request contains? Explain your changes.


  • Added for new features.
  • Changed for changes in existing functionality.
  • Deprecated for soon-to-be removed features.
  • Removed for now removed features.
  • Fixed for any bug fixes.
  • Security in case of vulnerabilities.

Explain your changes


Add a new command to have the ability to filter the content of a Profile and a Permission Set based on the content of multiple package.xml
The command takes a list of path of package.xml
The command takes a list of path where profile and permissionset should be located (recursively) to apply the filtering into them.
The command takes a list of userPermissions to keep. The actual behaviour is to remove every user permission not present in this white list.

Does this close any currently open issues?


No issue related

  • Jest test to check the fix is applied are added.

Any particular element to being able to test locally


To test it you have to call the command sfdx sgd:source:ppset -h

Any other comments?


This is WIP, no test case written yet and no traction from the community for this use case.
The current state of the code written is not acceptable

Where has this been tested?


Operating System: Darwin Kernel Version 18.7.0

Yarn version: 1.22.10

Node version: v15.6.0

sgd version: 4.1.0

git version: 2.30.0

const XML_PARSER_OPTION = {
ignoreAttributes: false,
ignoreNameSpace: false,
arrayMode: true,
Copy link
Owner Author

Choose a reason for hiding this comment

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

This can fix some potential issue in very edge case

.prettierignore Outdated Show resolved Hide resolved
src/utils/findInDir.ts Outdated Show resolved Hide resolved
@scolladon scolladon force-pushed the master branch 6 times, most recently from 220871b to ae44c14 Compare April 21, 2021 06:54
@scolladon scolladon changed the base branch from master to main December 18, 2021 15:00
@scolladon scolladon linked an issue Feb 2, 2022 that may be closed by this pull request

protected static requiresProject = true

public async run(): Promise<AnyJson> {
Copy link

Choose a reason for hiding this comment

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

Function run has 88 lines of code (exceeds 25 allowed). Consider refactoring.

src/commands/sgd/source/ppset.ts Outdated Show resolved Hide resolved
src/utils/findInDir.ts Outdated Show resolved Hide resolved
src/utils/findInDir.ts Outdated Show resolved Hide resolved
src/utils/findInDir.ts Outdated Show resolved Hide resolved
src/utils/findInDir.ts Outdated Show resolved Hide resolved
src/utils/findInDir.ts Outdated Show resolved Hide resolved
src/utils/findInDir.ts Outdated Show resolved Hide resolved
src/utils/findInDir.ts Outdated Show resolved Hide resolved
src/utils/findInDir.ts Outdated Show resolved Hide resolved
src/utils/findInDir.ts Outdated Show resolved Hide resolved

protected static requiresProject = true

public async run(): Promise<AnyJson> {
Copy link

Choose a reason for hiding this comment

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

Function run has 87 lines of code (exceeds 25 allowed). Consider refactoring.

src/utils/findInDir.ts Outdated Show resolved Hide resolved
src/utils/findInDir.ts Outdated Show resolved Hide resolved
src/utils/findInDir.ts Outdated Show resolved Hide resolved
src/utils/findInDir.ts Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jul 18, 2022

Codecov Report

Merging #90 (4df207a) into main (a231b86) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##              main       #90   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           23        23           
  Lines          633       633           
=========================================
  Hits           633       633           

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 a231b86...4df207a. Read the comment docs.

@scolladon scolladon changed the title Add new command to filter the content of Profile and Pset based on multiple package.xml feat: add a new command to filter the content of Profile and Pset based on multiple package.xml Jul 18, 2022

protected static requiresProject = true

public async run(): Promise<AnyJson> {
Copy link

Choose a reason for hiding this comment

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

Function run has 86 lines of code (exceeds 25 allowed). Consider refactoring.

@codeclimate
Copy link

codeclimate bot commented Jul 18, 2022

Code Climate has analyzed commit 4df207a and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

View more on Code Climate.

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.

Incrementally get Profile Changes
3 participants