jetstream icon indicating copy to clipboard operation
jetstream copied to clipboard

[WIP] Allow user to add a name to a deployment so that in history it can be…

Open joiecosby opened this issue 2 years ago • 5 comments

… more easily identified 

Adding new functionality that will allow users to save deployments. This should be accessible from all deployment options

resolves #331

joiecosby avatar May 14 '23 14:05 joiecosby

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 88049fece0ffe4445de6e3d08189a4819f91737a. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

nx-cloud[bot] avatar May 14 '23 14:05 nx-cloud[bot]

@paustint I am curious what opinions you have on the current build so far. At the moment, I have it working but it feels disjointed. I have worked it out for one scenario, the Deploy to Org button.

This is how the logic gets called for displaying the deployment options: DeploymentMetadataToOrg --> DeploymentMetadataPackageConfigModal --> DeploymentOptions

The logic gets called for displaying the deployment status: DeploymentMetadataToOrg --> DeployMetadataPackageStatusModal --> DeployMetadataStatusModal

The logic gets passed to and from DeploymentMetadataToOrg but I can't tell if there is a better way.

I am also running into the following error for DeployMetadataToOrgConfigModal:

Screen Shot 2023-05-15 at 19 13 32

And into this error in DeployOptions: Screen Shot 2023-05-15 at 19 46 06

Thank you in advance!

joiecosby avatar May 16 '23 02:05 joiecosby

@joiecosby - I didn't review everything in full detail, but here are some thoughts: It really does not feel right to add deploymentHistoryName to export interface DeployResult { since that should truly represent the data that Salesforce returns - I think we can remove this.

I would probably do something like this (I did not do a full analysis, just a cursory glance)

Basically just store the name locally wherever it is needed, and then pass it along with the function call to initiate the deployment (basically everywhere saveHistory({ is called)

// deploy-metadata.utils.tsx
export async function saveHistory({
...
deployOptions: DeployOptions;
+/** Optional name to use for history */
+name?: string;
...
}) {

// there are a few places very similar to this
// useDeployMetadata....tsx
-const deployMetadata = useCallback(async () => {
+const deployMetadata = useCallback(async (deploymentHistoryName?: string) => {
saveHistory({
...
+name: deploymentHistoryName,
...
});

paustint avatar May 16 '23 14:05 paustint

Notes from pair programming:

  • Change defining deploymentHistoryName as string | null and instead define as Maybe
  • Remove logic adding deploymentHistoryName to DeployResults instead wherever saveHistory() is being referenced, add the logic inside there
  • Make sure that we are including the logic for change set scenario and delete metadata scenario.

joiecosby avatar Jun 10 '23 15:06 joiecosby

☁️ Nx Cloud Report

CI is running/has finished running commands for commit cd7749719b85ea6a3e54d41e074fe27b4bb4cde8. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


🟥 Failed Commands
nx run-many --target=build --parallel=3 --projects=jetstream,api,download-zip-sw,landing --configuration=production

Sent with 💌 from NxCloud.

nx-cloud[bot] avatar Mar 21 '24 02:03 nx-cloud[bot]