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

Editing an application, the entrypoint in the form is not set correctly #721

Open
marcopiraccini opened this issue May 23, 2024 · 5 comments
Labels
bug Something isn't working meraki

Comments

@marcopiraccini
Copy link
Contributor

It always sets the first one

@marcopiraccini marcopiraccini added the bug Something isn't working label May 23, 2024
@marcopiraccini marcopiraccini changed the title Editing an application, the etnrypoint in the form is not set cottectly Editing an application, the entrypoint in the form is not set correctly May 23, 2024
@tonysnowboardunderthebridge
Copy link
Contributor

tonysnowboardunderthebridge commented May 23, 2024

HI @mcollina @marcopiraccini

I have added the following video.
I created an app with 3 services:

  • primo
  • secondo
  • terzo
Schermata 2024-05-23 alle 14 56 42

then I select terzo as entrypoint. As you can see terzo is the first selected service because is the entrypoint

Schermata 2024-05-23 alle 14 57 17

Here the PR to put this behavior (#428). I personally agree with the PR from @leorossi, also @Fmusso94 reported that during tests on meraki.

However there is a bug instead on the update of the application.
Changing the entrypoint is not considered (I found that the possible bug could be here https://github.com/platformatic/meraki/blob/main/src/main/generate.mjs#L158, I've already checked that the UI passed the new desired entrypoint name).

@mcollina
Copy link
Member

Note that the entry point is not updated at all when updating an application

@tonysnowboardunderthebridge
Copy link
Contributor

Note that the entry point is not updated at all when updating an application

Yep I noticed during tests today, I've already checked were the problem could be.
is a problem to have the entrypoint as first service?

@tonysnowboardunderthebridge
Copy link
Contributor

HI @mcollina @leorossi

the problem is on generator inside platformatic (https://github.com/platformatic/platformatic/blob/main/packages/runtime/lib/generator/runtime-generator.js#L335)

  1. I tried to
  • remove "terzo" as service
  • select "secondo" as entrypoint.

this cause the following problem

Error: Error invoking remote method 'open-app': FastifyError [PLT_CONFIG_CANNOT_PARSE_CONFIG_FILE]: Cannot parse config file. Invalid entrypoint: 'terzo' does not exist

  1. also setting a different entrypoint doesn't work https://github.com/platformatic/meraki/blob/main/src/main/generate.mjs#L158

(I tried to use the following code in the following )

if (!isUpdate) {
    // Creation
    generator.setEntryPoint(entrypoint)
    await generator.prepare()
    await generator.writeFiles()
  } else {
    await generator.loadFromDir()
    generator.setEntryPoint(entrypoint)
    generator.update({ services })
  }

But the application was not updated.

@leorossi
Copy link
Contributor

It's a bug on the generator that does not support this feature.

I opened an issue: platformatic/platformatic#2601 assigned to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working meraki
Projects
None yet
Development

No branches or pull requests

4 participants