We have a Forge app that is already in production. One of the developers added a new storage entity for testing purposes and deployed it to the development environment. Now, when we try to delete this entity from the manifest.yml file, an error occurs:
forge deploy
Warning: Your version of Forge CLI is out of date. We recommend you update to the latest version to get the latest features and bug fixes.
Run npm install -g @forge/cli@latest to update from version 7.1.0 to 8.0.0.
Deploying your app to the development environment.
Press Ctrl+C to cancel.
Running forge lint...
No issues found.
× Deploying wo-release-manager-app to development...
i Packaging app files
i Uploading app
i Validating manifest
Error: Manifest validation failed: Failed to validate custom entities
Additional information: [
{
"message": "Index \"groupname\" cannot be removed",
"extensions": {
"errorType": "BREAKING_CHANGES_NOT_SUPPORTED"
}
}
] (requestId: c5e3875ec06a4773bfe25a6230c82eda)
And also to be able to keep progressing I changed the manifest in that way :
app:
id: ari:cloud:ecosystem::app/fe1fc4d3-0cca-4989-9181-b7f5bd2978a4
storage:
entities:
- name: 'jiraproject-group'
attributes:
groupname:
type: 'string'
projectkey:
type: 'string'
indexes:
- groupname
- projectkey
# Index to query project groups by name
- name: 'by-groupName'
range:
- 'groupname'
- name: 'by-projectkey'
range:
- 'projectkey'
- name: 'jiraproject-group-test0001'
attributes:
groupname:
type: 'string'
projectkey:
type: 'string'
indexes:
# - groupname
# - projectkey
# Index to query project groups by name
- name: 'by-groupName'
range:
- 'groupname'
- name: 'by-projectkey'
range:
- 'projectkey'
Adding multiple indexes for the same entity, and also duplicating ‘jiraproject-group’ into ‘jiraproject-group-test0001’ completly, but that’s not a very clean approach.
Hi @KaiserSoft@Uli Thanks for the detailed response. This is a known limitation of the platform as mentioned here.
Once you’ve deployed your app, you cannot delete any entities, attributes, or indexes defined in your manifest. If you do, Forge will return an error the next time you deploy your app. We are working on addressing this in a future update.
You can still add new attributes and indexes to an existing entity. Doing so will not count as an entity deletion.
There are 2 types of errors that you are seeing -
First one - In this, you are trying to delete an entity which is not allowed as per the above link.
Further, can you help me understand what are you trying to achieve by duplicating the entity as in the original request you wanted to remove the entity?
So as I try different things I have to change things and repair my mistakes…
From what I understand I’ll continue to hack my way to make it work and then I’ll start the app from scratch coping files to a new project so I can have a clean setup. At least I know now
The issue is that we deployed the manifest.yml with a test entity to a Development environment by a mistake (“forge deploy”). Now, we cannot proceed with app development because it requires this entity, and we are no longer deploying to the Development environment.
Is there any way to delete the “corrupted” Development environment and recreate it again? We don’t need this redundant “test” entities in the production version of the app. By the way, our app ID is d47d1c6f-016e-478e-adbd-d890fb7951e4.
If you have access, could you please recreate the development environment from scratch? We will redeploy the correct version of the app. Alternatively, are you able to delete ALL entities from our app? We will deploy the correct manifest.yml afterward.
Thank you both for giving the complete context. Can you clarify why is this a development blocker for you? You can keep the entity definition same in the manifest file and deploy your app to any env (say production).
Dead code (and dead database entries) is quite a bad practice… useless indexes or entities makes for more confusion when trying to understand the code later on or for someone else.
Keeping dead code and redundant database entries can lead to inefficiencies and confusion in the codebase. It makes it harder for developers, including yourself or others, to understand and maintain the code in the future. Would you consider removing the dead code and unused database entries to improve the clarity and maintainability of our project?
Hi both, Yes you are right about dead code. To unblock your development, I checked this internally and we can do an exception for you. We will be able to trigger the deletion of entities and the data associated with them if you raise a ticket here providing the relevant information like appId, app link (if in marketplace), entities you want to delete. We should be able to do that by the end of next week.
Hi, I signed up to the EAP, and was accepted, but I can’t find any instructions on how to delete the storage entries (and removing them from the manifest still just seems to throw the ‘you can’t do that’ error. Are there instructions anywhere?
Thanks.
I misunderstood the EAP - it’s for deleting the indexes. At this time you can’t delete Custom Entities. It’s recommended that you either delete the app while in development, and re-register it with the updates or just leave them in.
Please note that, due to recent changes in Forge platform, we can no longer make this exception as it’s now technically not possible to perform the manual delete operation.