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 handle Duplicates to EnvironmentVariableExporter and remove duplicate env variables #5783

Merged
merged 3 commits into from Dec 8, 2023

Conversation

estebangallego
Copy link
Contributor

@estebangallego estebangallego commented Dec 7, 2023

Issue & Reproduction Steps

This PR addresses a critical issue related to the automatic creation of environment variables with the same name, which was occurring excessively—surpassing the limit of 100 instances.

The modifications implemented in this PR effectively resolve the problem, ensuring that the generation of environment variables can handle duplicates in increments and remove all the duplicates.

Solution

  • Add $handleDuplicatesByIncrementing to the EnvironmentVariableExporter Class
  • Add an upgrade migration to delete all the env duplicates.

How to Test

In this case, we need to run a few tests, the first one is to make sure all duplicate env variables are been incremented and the second test is to make sure all the duplicate env variables have been deleted.

First Test:
Import PM Block:

  • Download the financial-assistant.json file.
  • Import the attached PM Block into your environment.
  • Revisit the database and ensure that duplicates have been appropriately incremented. (ess #)
  • Confirm that duplicate environment variables now display a unique number appended at the end of their names.
  • Now you can Delete the ess variables manually

Second test:

  • The second test will need all of the duplicates with out the increment so in this case, please comment out the $handleDuplicatesByIncrementing flag within the EnvironmentVariableExporter and reimport the file.
  • This will give you all the duplicate environment variables again ess.
  • run 'php artisan upgrade'
  • Please ensure that all of the ess variables have been successfully removed from the DB.

Related Tickets & Packages

FOUR-12763

Code Review Checklist

  • I have pulled this code locally and tested it on my instance, along with any associated packages.
  • This code adheres to ProcessMaker Coding Guidelines.
  • This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
  • This solution fixes the bug reported in the original ticket.
  • This solution does not alter the expected output of a component in a way that would break existing Processes.
  • This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
  • This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
  • This code does not duplicate functionality that already exists in the framework or in ProcessMaker.
  • This ticket conforms to the PRD associated with this part of ProcessMaker.

@estebangallego estebangallego marked this pull request as ready for review December 7, 2023 22:02
@estebangallego estebangallego marked this pull request as draft December 7, 2023 22:02
@estebangallego estebangallego changed the title Add $handleDuplicatesByIncrementing to the EnvironmentVariableExporter Class Add handle Duplicates to EnvironmentVariableExporter and remove duplicate env variables Dec 7, 2023
@estebangallego estebangallego marked this pull request as ready for review December 7, 2023 23:42
Copy link

@ryancooley ryancooley merged commit 04f1cfb into develop Dec 8, 2023
10 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants