Skip to content

Commit

Permalink
Merge branch 'main' into bug/linux-rename-working-dir
Browse files Browse the repository at this point in the history
  • Loading branch information
jstvz authored Jan 9, 2025
2 parents 38d6611 + ee72965 commit 0cd883e
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 125 deletions.
2 changes: 1 addition & 1 deletion cumulusci/__about__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "4.0.1.dev0"
__version__ = "4.0.1.dev1"
11 changes: 0 additions & 11 deletions cumulusci/tasks/bulkdata/select_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
from pydantic import Field, root_validator, validator

from cumulusci.core.enums import StrEnum
from cumulusci.tasks.bulkdata.extract_dataset_utils.hardcoded_default_declarations import (
DEFAULT_DECLARATIONS,
)
from cumulusci.tasks.bulkdata.utils import CaseInsensitiveDict
from cumulusci.utils import get_cci_upgrade_command
from cumulusci.utils.yaml.model_parser import CCIDictModel
Expand Down Expand Up @@ -188,10 +185,6 @@ def standard_generate_query(
filter_clause=user_filter, limit_clause=limit, offset_clause=offset
)
else:
# Get the WHERE clause from DEFAULT_DECLARATIONS if available
declaration = DEFAULT_DECLARATIONS.get(sobject)
if declaration:
query += f" WHERE {declaration.where}"
query += f" LIMIT {limit}" if limit else ""
query += f" OFFSET {offset}" if offset else ""
return query, ["Id"]
Expand Down Expand Up @@ -281,10 +274,6 @@ def similarity_generate_query(
filter_clause=user_filter, limit_clause=limit, offset_clause=offset
)
else:
# Get the WHERE clause from DEFAULT_DECLARATIONS if available
declaration = DEFAULT_DECLARATIONS.get(sobject)
if declaration:
query += f" WHERE {declaration.where}"
query += f" LIMIT {limit}" if limit else ""
query += f" OFFSET {offset}" if offset else ""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ interactions:

- request:
method: GET
uri: https://orgname.my.salesforce.com/services/data/v62.0/query/?q=SELECT%20Id,%20Name,%20Description,%20Phone,%20AccountNumber%20FROM%20Account%20WHERE%20Name%20!=%20'Sample%20Account%20for%20Entitlements'
uri: https://orgname.my.salesforce.com/services/data/v62.0/query/?q=SELECT%20Id,%20Name,%20Description,%20Phone,%20AccountNumber%20FROM%20Account
body: null
headers: *id004
response:
Expand Down Expand Up @@ -125,7 +125,7 @@ interactions:

- request:
method: GET
uri: https://orgname.my.salesforce.com/services/data/v62.0/query/?q=SELECT%20Id%20FROM%20Account%20WHERE%20Name%20!=%20'Sample%20Account%20for%20Entitlements'%20LIMIT%205
uri: https://orgname.my.salesforce.com/services/data/v62.0/query/?q=SELECT%20Id%20FROM%20Account%20LIMIT%205
body: null
headers: *id004
response:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ interactions:

- request:
method: GET
uri: https://orgname.my.salesforce.com/services/data/v62.0/query/?q=SELECT%20Id,%20Name,%20Description,%20Phone,%20AccountNumber%20FROM%20Account%20WHERE%20Name%20!=%20'Sample%20Account%20for%20Entitlements'
uri: https://orgname.my.salesforce.com/services/data/v62.0/query/?q=SELECT%20Id,%20Name,%20Description,%20Phone,%20AccountNumber%20FROM%20Account
body: null
headers: *id004
response:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ interactions:

- request:
method: GET
uri: https://orgname.my.salesforce.com/services/data/v62.0/query/?q=SELECT%20Id,%20Name,%20Description,%20Phone,%20AccountNumber%20FROM%20Account%20WHERE%20Name%20!=%20'Sample%20Account%20for%20Entitlements'
uri: https://orgname.my.salesforce.com/services/data/v62.0/query/?q=SELECT%20Id,%20Name,%20Description,%20Phone,%20AccountNumber%20FROM%20Account
body: null
headers: *id004
response:
Expand Down Expand Up @@ -125,7 +125,7 @@ interactions:

- request:
method: GET
uri: https://orgname.my.salesforce.com/services/data/v62.0/query/?q=SELECT%20Id%20FROM%20Account%20WHERE%20Name%20!=%20'Sample%20Account%20for%20Entitlements'%20LIMIT%205
uri: https://orgname.my.salesforce.com/services/data/v62.0/query/?q=SELECT%20Id%20FROM%20Account%20LIMIT%205
body: null
headers: *id004
response:
Expand Down
57 changes: 3 additions & 54 deletions cumulusci/tasks/bulkdata/tests/test_select_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,7 @@
PANDAS_AVAILABLE = False


# Test Cases for standard_generate_query
def test_standard_generate_query_with_default_record_declaration():
select_operator = SelectOperationExecutor(SelectStrategy.STANDARD)
sobject = "Account" # Assuming Account has a declaration in DEFAULT_DECLARATIONS
limit = 5
offset = 2
query, fields = select_operator.select_generate_query(
sobject=sobject, fields=[], user_filter="", limit=limit, offset=offset
)

assert "WHERE" in query # Ensure WHERE clause is included
assert f"LIMIT {limit}" in query
assert f"OFFSET {offset}" in query
assert fields == ["Id"]


def test_standard_generate_query_without_default_record_declaration():
def test_standard_generate_query_without_filter():
select_operator = SelectOperationExecutor(SelectStrategy.STANDARD)
sobject = "Contact" # Assuming no declaration for this object
limit = 3
Expand All @@ -49,7 +33,6 @@ def test_standard_generate_query_without_default_record_declaration():
sobject=sobject, fields=[], user_filter="", limit=limit, offset=offset
)

assert "WHERE" not in query # No WHERE clause should be present
assert f"LIMIT {limit}" in query
assert "OFFSET" not in query
assert fields == ["Id"]
Expand All @@ -72,23 +55,7 @@ def test_standard_generate_query_with_user_filter():
assert fields == ["Id"]


# Test Cases for random generate query
def test_random_generate_query_with_default_record_declaration():
select_operator = SelectOperationExecutor(SelectStrategy.RANDOM)
sobject = "Account" # Assuming Account has a declaration in DEFAULT_DECLARATIONS
limit = 5
offset = 2
query, fields = select_operator.select_generate_query(
sobject=sobject, fields=[], user_filter="", limit=limit, offset=offset
)

assert "WHERE" in query # Ensure WHERE clause is included
assert f"LIMIT {limit}" in query
assert f"OFFSET {offset}" in query
assert fields == ["Id"]


def test_random_generate_query_without_default_record_declaration():
def test_random_generate_query():
select_operator = SelectOperationExecutor(SelectStrategy.RANDOM)
sobject = "Contact" # Assuming no declaration for this object
limit = 3
Expand All @@ -97,7 +64,6 @@ def test_random_generate_query_without_default_record_declaration():
sobject=sobject, fields=[], user_filter="", limit=limit, offset=offset
)

assert "WHERE" not in query # No WHERE clause should be present
assert f"LIMIT {limit}" in query
assert "OFFSET" not in query
assert fields == ["Id"]
Expand Down Expand Up @@ -209,23 +175,7 @@ def test_random_post_process_with_no_records():
assert error_message == f"No records found for {sobject} in the target org."


# Test Cases for Similarity Generate Query
def test_similarity_generate_query_with_default_record_declaration():
select_operator = SelectOperationExecutor(SelectStrategy.SIMILARITY)
sobject = "Account" # Assuming Account has a declaration in DEFAULT_DECLARATIONS
limit = 5
offset = 2
query, fields = select_operator.select_generate_query(
sobject, ["Name"], [], limit, offset
)

assert "WHERE" in query # Ensure WHERE clause is included
assert fields == ["Id", "Name"]
assert f"LIMIT {limit}" in query
assert f"OFFSET {offset}" in query


def test_similarity_generate_query_without_default_record_declaration():
def test_similarity_generate_query_no_nesting():
select_operator = SelectOperationExecutor(SelectStrategy.SIMILARITY)
sobject = "Contact" # Assuming no declaration for this object
limit = 3
Expand All @@ -234,7 +184,6 @@ def test_similarity_generate_query_without_default_record_declaration():
sobject, ["Name"], [], limit, offset
)

assert "WHERE" not in query # No WHERE clause should be present
assert fields == ["Id", "Name"]
assert f"LIMIT {limit}" in query
assert "OFFSET" not in query
Expand Down
121 changes: 67 additions & 54 deletions docs/history.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

<!-- latest-start -->

## v4.0.1.dev1 (2025-01-01)

<!-- Release notes generated using configuration in .github/release.yml at main -->

## What's Changed

### Changes 🎉

- @W-17427085: Set ANNOY related dependencies to be optional by [@aditya-balachander](https://github.com/aditya-balachander) in [#3858](https://github.com/SFDO-Tooling/CumulusCI/pull/3858)
- Update on the documentation for SFDX_ORG_CREATE_ARGS environment variable by [@lakshmi2506](https://github.com/lakshmi2506) in [#3861](https://github.com/SFDO-Tooling/CumulusCI/pull/3861)

**Full Changelog**: https://github.com/SFDO-Tooling/CumulusCI/compare/v4.0.1.dev0...v4.0.1.dev1

<!-- latest-stop -->

## v4.0.1.dev0 (2024-12-16)

<!-- Release notes generated using configuration in .github/release.yml at main -->
Expand All @@ -19,8 +34,6 @@

**Full Changelog**: https://github.com/SFDO-Tooling/CumulusCI/compare/v4.0.1...v4.0.1.dev0

<!-- latest-stop -->

## v4.0.1 (2024-11-18)

### Issues Fixed 🩴
Expand Down Expand Up @@ -1711,9 +1724,9 @@ Critical Changes:
subfolders will see a change in resolution behavior. Previously,
a dependency specified like this:

dependencies:
- github: https://github.com/SalesforceFoundation/NPSP
subfolder: unpackaged/config/trial
dependencies:
- github: https://github.com/SalesforceFoundation/NPSP
subfolder: unpackaged/config/trial

would always deploy from the latest commit on the default
branch. Now, this dependency will be resolved to a GitHub commit
Expand All @@ -1724,12 +1737,12 @@ Critical Changes:
- The `project__dependencies` section in `cumulusci.yml` no longer
supports nested dependencies specified like this:

dependencies:
- namespace: "test"
version: "1.0"
dependencies:
- namespace: "parent"
version: "2.2"
dependencies:
- namespace: "test"
version: "1.0"
dependencies:
- namespace: "parent"
version: "2.2"

All dependencies should be listed in install order.

Expand Down Expand Up @@ -1898,12 +1911,12 @@ Critical changes:
- The `project__dependencies` section in `cumulusci.yml` will no
longer support nested dependencies specified like this :

dependencies:
- namespace: "test"
version: "1.0"
dependencies:
- namespace: "parent"
version: "2.2"
dependencies:
- namespace: "test"
version: "1.0"
dependencies:
- namespace: "parent"
version: "2.2"

All dependencies should be listed in install order.

Expand Down Expand Up @@ -3510,33 +3523,33 @@ New features:

: -

Added keywords for generating a collection of sObjects according to a template:
Added keywords for generating a collection of sObjects according to a template:

: - `Generate Test Data`
- `Salesforce Collection Insert`
- `Salesforce Collection Update`
: - `Generate Test Data`
- `Salesforce Collection Insert`
- `Salesforce Collection Update`

-
-

Changes to Page Objects:
Changes to Page Objects:

: - More than one page object can be loaded at once.
Once loaded, the keywords of a page object remain
visible in the suite. Robot will give priority to
keywords in the reverse order in which they were
imported.
- There is a new keyword, `Log Current Page Object`,
which can be useful to see information about the
most recently loaded page object.
- There is a new keyword, `Get Page Object`, which
will return the robot library for a given page
object. This can be used in other keywords to access
keywords from another page object if necessary.
- The `Go To Page` keyword will now automatically load
the page object for the given page.
: - More than one page object can be loaded at once.
Once loaded, the keywords of a page object remain
visible in the suite. Robot will give priority to
keywords in the reverse order in which they were
imported.
- There is a new keyword, `Log Current Page Object`,
which can be useful to see information about the
most recently loaded page object.
- There is a new keyword, `Get Page Object`, which
will return the robot library for a given page
object. This can be used in other keywords to access
keywords from another page object if necessary.
- The `Go To Page` keyword will now automatically load
the page object for the given page.

- Added a basic debugger for Robot tests. It can be enabled
using the `-o debug True` option to the robot task.
- Added a basic debugger for Robot tests. It can be enabled
using the `-o debug True` option to the robot task.

- Added support for deploying new metadata types
`ProfilePasswordPolicy` and `ProfileSessionSetting`.
Expand Down Expand Up @@ -3611,8 +3624,8 @@ New features:
permanently set this option, add this in
`~/.cumulusci/cumulusci.yml`:

cli:
plain_output: True
cli:
plain_output: True

- Added additional info to the `cci version` command, including the
Python version, an upgrade check, and a warning on Python 2.
Expand Down Expand Up @@ -4893,12 +4906,12 @@ Resolving a few issues from beta77:
below. In flows that need to inject the actual namespace prefix,
override the [unmanaged]{.title-ref} option .. :

custom_deploy_task:
class_path: cumulusci.tasks.salesforce.Deploy
options:
path: your/custom/metadata
namespace_inject: $project_config.project__package__namespace
unmanaged: False
custom_deploy_task:
class_path: cumulusci.tasks.salesforce.Deploy
options:
path: your/custom/metadata
namespace_inject: $project_config.project__package__namespace
unmanaged: False

### Enhancements

Expand Down Expand Up @@ -5613,13 +5626,13 @@ Resolving a few issues from beta77:
- **IMPORANT** This release changes the yaml structure for flows. The
new structure now looks like this:

flows:
flow_name:
tasks:
1:
task: deploy
2:
task: run_tests
flows:
flow_name:
tasks:
1:
task: deploy
2:
task: run_tests

- See the new flow customization examples in the cookbook for examples
of why this change was made and how to use it:
Expand Down

0 comments on commit 0cd883e

Please sign in to comment.