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

Added a custom index for LogEntry__c.OriginLocation__c #411

Merged
merged 2 commits into from
May 31, 2023

Conversation

jongpie
Copy link
Owner

@jongpie jongpie commented Nov 22, 2022

Fixes #400 by adding a custom index for the field LogEntry__c.OriginLocation__c, using the new CustomIndex metadatatype. This should help to improve queries & reports that filter on this field.

@jongpie jongpie added Type: Enhancement New feature or request Salesforce Feature: Reporting Anything related to reports, dashboards, and the underlying data model labels Nov 22, 2022
@jongpie jongpie temporarily deployed to Experience Cloud Scratch Org November 22, 2022 19:39 Inactive
@jongpie jongpie temporarily deployed to Base Scratch Org November 22, 2022 19:39 Inactive
@jongpie jongpie temporarily deployed to Demo Org November 22, 2022 19:50 Inactive
@jongpie jongpie temporarily deployed to Demo Org November 22, 2022 20:01 Inactive
@jongpie jongpie force-pushed the feature/custom-index-for-log-entry-origin-location branch from 80bcbc4 to 1c7e9b3 Compare November 23, 2022 18:22
@jongpie jongpie marked this pull request as ready for review November 23, 2022 18:22
@jongpie jongpie temporarily deployed to Base Scratch Org November 23, 2022 18:45 Inactive
@jongpie jongpie temporarily deployed to Experience Cloud Scratch Org November 23, 2022 18:45 Inactive
@jongpie jongpie temporarily deployed to Demo Org November 23, 2022 18:55 Inactive
@jongpie jongpie temporarily deployed to Demo Org November 23, 2022 19:07 Inactive
@jongpie
Copy link
Owner Author

jongpie commented Nov 23, 2022

I've been doing some testing of the new CustomIndex metadata type - overall, it seems to work well, but I'm currently running into issues with trying to delete a custom index.

I've tried deleting with sfdx using both the new source and older mdapi commands, but neither seems to work - they both throw an exception insufficient access rights on cross-reference id

  • sfdx force:mdapi:deploy -d ./customindexDelete -w -1 (assuming you have a folder called 'customindexDelete' with all of the appropriate XML files)

    image

  • sfdx force:source:delete --metadata CustomIndex:LogEntry__c.OriginLocation__c

    image

I'll continue testing this - it makes me a little nervous to merge this PR before having a rollback plan in place (just in case there's some negative impact in some orgs), so I want to figure out deleting the index before I release this change.

@JeroenSfdc
Copy link

Agree @jongpie since not documented as such, that fact that deploying the meta-data 'works' (did you run an explain plan to see if truly the field was indexed, not only 'checked' as indexed) is tricky. Risk-reward is not such that this needs to be pushed.

@jongpie
Copy link
Owner Author

jongpie commented Nov 29, 2022

@JeroenSfdc yeah, I ran a few tests before & after deploying the custom index, and it does appear to be actually indexing the field - but given that I haven't found a way yet to delete the custom index, I'm going to hold off on merging this PR for now.

I'll try reaching out internally at Salesforce to see if anyone can provide me with some more info on the new metadata type - if/when I can figure out how to delete a custom index, then I think I'll move forward with merging this PR.

…inLocation__c (using the new CustomIndex metadatatype) to improve queries & reports that filter on this field
@jongpie jongpie force-pushed the feature/custom-index-for-log-entry-origin-location branch from cf11831 to 9cdba05 Compare May 31, 2023 18:59
@jongpie jongpie had a problem deploying to Base Scratch Org May 31, 2023 19:03 — with GitHub Actions Failure
@jongpie jongpie temporarily deployed to Experience Cloud Scratch Org May 31, 2023 19:03 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Experience Cloud Scratch Org May 31, 2023 19:26 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Base Scratch Org May 31, 2023 19:26 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Demo Org May 31, 2023 19:35 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Demo Org May 31, 2023 19:46 — with GitHub Actions Inactive
@codecov
Copy link

codecov bot commented May 31, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (da3bbaa) 95.07% compared to head (9cdba05) 95.07%.

❗ Current head 9cdba05 differs from pull request most recent head 99b3da8. Consider uploading reports for the commit 99b3da8 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #411   +/-   ##
=======================================
  Coverage   95.07%   95.07%           
=======================================
  Files          59       59           
  Lines        5944     5944           
  Branches      129      129           
=======================================
  Hits         5651     5651           
  Misses        288      288           
  Partials        5        5           
Flag Coverage Δ
Apex 95.49% <ø> (ø)
LWC 92.83% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...-logger/core/main/logger-engine/classes/Logger.cls 96.11% <ø> (ø)
...ogger/core/main/logger-engine/lwc/logger/logger.js 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@jongpie jongpie merged commit 8db89d0 into main May 31, 2023
@jongpie jongpie deleted the feature/custom-index-for-log-entry-origin-location branch May 31, 2023 21:53
@jongpie
Copy link
Owner Author

jongpie commented May 31, 2023

@JeroenSfdc this is now available in the v4.10.5 release. I've talked with a few other people that are using the new CustomIndex metadata type, and so far, it seems to be going well for everyone, so it made sense to finally merge this PR.

@JeroenSfdc
Copy link

Nice @jongpie! Since we're on the manage package, will need to wait a bit. Thanks a lot!

@jongpie
Copy link
Owner Author

jongpie commented Jun 6, 2023

@JeroenSfdc just FYI, I'm hoping to have the managed package release (v4.11.0) released next week (PR #507) 🥳 It'll include the new custom index, as well as a few other enhancements).

@jongpie
Copy link
Owner Author

jongpie commented Jun 20, 2023

@JeroenSfdc, some unfortunate news, I'm not going to include the custom index in the next managed package release (v4.11.0)

I've recently seen a few errors about the custom index in a couple of unrelated orgs that deploy Nebula Logger's metadata (instead of using the unlocked or managed packages). For some reason, the inclusion of the custom index causes a deployment error. It doesn't seem to be a widespread issue (I only know of 2-3 orgs impacted)), and I can't reproduce the issue myself in any of my own orgs, so it could be something specific to those orgs. But as a precaution, I'm going to exclude it from the managed package this release to avoid any upgrade issues.

In the meantime, I'll continue to investigate these errors further - hopefully, I'll be able to include the index in the next managed package release, v4.12.0 (Winter '24).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on hold Salesforce Feature: Reporting Anything related to reports, dashboards, and the underlying data model Type: Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide a solution for indexing the field LogEntry__c.OriginLocation__c
3 participants