Remove Unused Elements on Deploy
1030
Views
22
Comments
On our RadarOn our Radar
1CP

It would be very nice to have a check box when deploying from environment to environment which would allow you to remove unused elements in all applications. Similar to how the feature works within Service Studio

I find it very helpful having everything at hand when developing  but once deployed to test or production environments there is no need for the extra baggage.

2014-02-07 17-02-43
Vasco Pessanha
Changed the category to
1CP

I like the sentiment (I am in favor of ANYTHING that makes "Remove Unused Elements" happen more often!), but it also means that your PROD code is different from your DEV code, which is objectionable (especially in a DevOps world with containers and CI/CD with containers).

J.Ja

Changed the status to
On our RadarOn our radar

Hi Oliver!


Thank you for the idea!

We have been thinking about this topic for a while.

@Oliver and @Justin, can you share a few scenarios where you see cleaning of unused elements for multiple modules/applications/solutions to be most useful? What about the granularity - all vs a subset of existing modules/applications/solutions?

Stoyan -

Just remove ALL unused elements from everything being deployed. Keep the compiled code size as small and efficient as possible. There is no reason to have all of those extra dependencies compiled in.

J.Ja

Justin,


Don't you think that removing all unused references, by default, whenever something gets published might result in some loss of development speed? E.g. system actions or silk elements that might be needed shortly afterwards, but are not currently in use?

I agree with Justin, the choice to remove all unused elements once you go from a Development environment into a Test or Live environment would be great. Whilst also keeping these elements in your development environment for the exact reason you mentioned Stoyan. 


Many thanks,

Oliver

Great to hear this feedback Oliver!


The only thing I am not entirely aligned with is the "clearing references" when staging to PRD. I believe that whatever reaches PRD must have been validated, as is, in previous environments. It would introduce too much risk to be making changes (as benign as these might be) to applications/solutions in the process of these going Live.

Yes, that's why this should be done when deploying to ANY environment through Lifetime. That way it gets tested in QA.

Also, this idea has nothing to do with development speed, because it is NOT about doing it in dev, it's about doing a deployment BETWEEN environments (a Lifetime deployment).

J.Ja

Cheers Justin! Really clarifying this!

Just went to raise this idea, glad to see it is already been thought of and on the radar!

Merged this idea with 'LifeTime - Remove Unused dependencies on publish (Cleanup)' (created on 12 Feb 2020 11:02:46 by Patrick Baanvinger)

Situation:

When I develop an application, I tend to reference "everything" from eSpaces and Extensions I am using (Not everything on the server ;)). 

To have a complete set of tools works better than to reference each individual item on a "need to have" basis. 

For instance:

When I need something from WebPatterns or OutSystems UI, I select everything to have the tools available.

Problem:

When I want to promote a version to the next server using LifeTime, the systems gets all the referenced stuff, creates a package and deploys it on the next server. Even the references which are not used. 

This results in larger applications and unnecessary references (and potential problems)

Off course you can say, you have to clean your solution before promoting, or be restrictive on references, but this has three major flaws:

  1. As a developer, I want to develop as fast as possible and with the least amount of waiting to get my gear (Ergo, change my references on a need to have basis)
  2. It just takes one developer on one moment to create references which are not needed (anymore) and bloating up the solution
  3. Serious applications consists of multiple modules, across multiple applications each with their own references. A promotion using LifeTime, means I have to open Service Studio and check all applications and eSpaces, which costs a lot of time (opening/refreshing/publishing/repeat on all you applications and modules).

Service Studio is not efficient in these tasks. It focuses on development in a module/application. It is not equipped to manage large solutions.

Service Studio has a "Remove unused dependencies" function, but only on the active module.

Service Center has a publish application function, which refreshes the application but does not do any cleaning.


Idea:

When promoting a solution using LifeTime deployment, include an optional checkbox to remove unused references (E.g. "Remove unused references on deploy")  from the modules/applications which are deployed on the target server.

When this option is checked (Over simplified pseudo solution):

  1. Publish the application package on the target server as-is (Source server is not modified), using the existing functionality.
  2. If the checkbox "Remove unused references on deploy" is checked and when published to a server which is marked as Development, execute the "remove unused dependencies" for each published module.
    (This could be more efficient, but these functions are already in the platform at the moment. It should be done on the target server, to prevent it changes the environment on the source server, forcing the developer to re-reference the libraries. More efficient for instance would be to cleanup "in memory" before deployment to prevent the deployment of referenced modules which are not used at all in the code)
  3. (Re-?)Compile the application on the target server with the cleaned solution

Why only on a server marked as Development?
In "normal situations", we use an DTAP solution, where D and T usually are marked as development servers. A (sometimes) and P are production servers. The main issue is in the deployment from D-server to T-server.
In the proposed scenario,

  • We can reference as a developer whatever we want on the D server. 
  • Deployment to the T server, will be executed with the clean-up, so we can test its functionality with the cleaned solution.
  • Deployment to the A and P server, we deploy the version as is, because we do not want the solution to be changed without proper testing.






This comment was:
- originally posted on idea 'LifeTime - Remove Unused dependencies on publish (Cleanup)' (created on 12 Feb 2020 by Patrick Baanvinger)
- merged to idea 'Remove Unused Elements on Deploy' on 18 Feb 2020 14:14:29 by Justin James
Changed the category to
Lifetime


This comment was:
- originally posted on idea 'LifeTime - Remove Unused dependencies on publish (Cleanup)' (created on 12 Feb 2020 by Patrick Baanvinger)
- merged to idea 'Remove Unused Elements on Deploy' on 18 Feb 2020 14:14:29 by Justin James
Merged this idea with 'Automate Remove Unused Dependencies when publish to QA or PROD Servers' (created on 28 Apr 2020 09:47:30 by Sylvain Billot)

When we use Lifetime to publish an application to QA or to Production server, if we have forget to remove Unused Depencies, we risk to publish a lots of unused Application Objects that consume AO licence.

THe idea is to have an option to automate Remove Unused Dependencies in the Lifetime UI that we can check before we publish applications on QA or on PROD server.



This comment was:
- originally posted on idea 'Automate Remove Unused Dependencies when publish to QA or PROD Servers' (created on 28 Apr 2020 by Sylvain Billot)
- merged to idea 'Remove Unused Elements on Deploy' on 30 Apr 2020 18:22:52 by Justin James
Changed the category to
Lifetime


This comment was:
- originally posted on idea 'Automate Remove Unused Dependencies when publish to QA or PROD Servers' (created on 28 Apr 2020 by Sylvain Billot)
- merged to idea 'Remove Unused Elements on Deploy' on 30 Apr 2020 18:22:52 by Justin James
Merged this idea with 'Automatically remove unused dependencies when deploying to test/production' (created on 11 Aug 2020 07:47:12 by Bas de Jong)

Hi,

By default OutSystems packs in a lot of dependencies in your application that you might not need when releasing to test/acceptance/production. However, sometimes it is useful to keep them referenced in the DEV environment. 

Can it be possible when deploying your application to TST/ACC/PRD that lifetime automatically strips your application from every dependency that is not in use?



This comment was:
- originally posted on idea 'Automatically remove unused dependencies when deploying to test/production' (created on 11 Aug 2020 by Bas de Jong)
- merged to idea 'Remove Unused Elements on Deploy' on 16 Aug 2020 00:54:15 by Justin James

+1



This comment was:
- originally posted on idea 'Automatically remove unused dependencies when deploying to test/production' (created on 11 Aug 2020 by Bas de Jong)
- merged to idea 'Remove Unused Elements on Deploy' on 16 Aug 2020 00:54:15 by Justin James
Merged this idea with 'Remove Unused Dependencies when publishing in Lifetime' (created on 16 Dec 2020 13:09:58 by Darren Meldrum)

During Development, it is normal to leave dependencies to modules that you are not using - you may after all need them later, and it is a pain to remove unused dependencies and then have to add them back in later.

However in Pre-Prod and Production environments, there is no benefit to leaving in dependencies that are not used, and it makes promoting apps to those environments more complex and time consuming when there are many dependencies.

Can we have an option in Lifetime to Remove Unused Dependencies when publishing from Development to later environments?



This comment was:
- originally posted on idea 'Remove Unused Dependencies when publishing in Lifetime' (created on 16 Dec 2020 by Darren Meldrum)
- merged to idea 'Remove Unused Elements on Deploy' on 19 Dec 2020 02:39:52 by Justin James

I think this would be usefull to have an option to remove unused dependencies in environments set to Production. But it then would create another version of the Espaces itself. It could have impact in the compare and merge when hot fixing the application and features related like tagging. But nice idea, +1



This comment was:
- originally posted on idea 'Remove Unused Dependencies when publishing in Lifetime' (created on 16 Dec 2020 by Darren Meldrum)
- merged to idea 'Remove Unused Elements on Deploy' on 19 Dec 2020 02:39:52 by Justin James