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

Image create command with implicit template uses older stable version #652

Open
Bajger opened this issue Jan 19, 2024 · 7 comments
Open
Labels

Comments

@Bajger
Copy link
Member

Bajger commented Jan 19, 2024

Describe the bug
When creating new image, without specifying template, old version of stable Pharo is used.

To Reproduce
Steps to reproduce the behavior:

  1. Execute: ./pharo-launcher image create my2
  2. See log:
Creating the local Pharo image based on template: Pharo 10.0 - 64bit (stable).
Please wait a moment.
Done!
  1. P10 version for stable version is used, but should be P11.

Expected behavior
Latest stable Pharo version should be used P11 (instead of P10).

Screenshots
If applicable, add screenshots to help explain your problem.

Version information:

Expected development cost
Probably it has something to do with dowloading sources template list.
I tried following, but it didn't really help:


cmd := PhLImageCreateCliCommand new.
cmd pharoLauncherModel: PharoLauncherCLIModel fromDefaultConfiguration.
PhLPharoTemplateSources checkForUpdates.
cmd latestStableTemplate 
@demarey
Copy link
Contributor

demarey commented Jan 19, 2024

It is working for me.
It is because you have an outdated sources.list file.
By the way, there is a missing feature to check if the official sources file changed (as for UI version)

@Bajger
Copy link
Member Author

Bajger commented Jan 19, 2024

t is because you have an outdated sources.list file.

It could be, but it didn't help even if I called PhLPharoTemplateSources checkForUpdates. It should update list templates, right?

By the way, there is a missing feature to check if the official sources file changed (as for UI version)

Do we want to have explicit command for this? I guess it shouldn't be updated everytime I invoke CLI command. What do you think?

@demarey
Copy link
Contributor

demarey commented Jan 19, 2024

t is because you have an outdated sources.list file.

It could be, but it didn't help even if I called PhLPharoTemplateSources checkForUpdates. It should update list templates, right?

It will just check but if you had no notification and did not accept the update, nothing will happen.

Do we want to have explicit command for this? I guess it shouldn't be updated everytime I invoke CLI command. What do you think?

Not every time. With poor (or no) internet connexion, pharo launcher will be unusable. We should have a way to determine the last check. I think one time a day is already enough. A command is not mandatory if we do so.

@Bajger
Copy link
Member Author

Bajger commented Jan 22, 2024

I used this, seen UI to check updates (notification), but still image templates aren't updated.

|cmd|
PhLTemplateSourcesUpdateChecker uniqueInstance check.
cmd := PhLImageCreateCliCommand new.
cmd pharoLauncherModel: PharoLauncherCLIModel fromDefaultConfiguration.

cmd latestStableTemplate 


@demarey
Copy link
Contributor

demarey commented Jan 22, 2024

PhLTemplateSourcesUpdateChecker>>#basicUpdateTemplateSources is in charge of updating sources. But it uses PharoLauncherApplication. so, not so good for CI.
What should be done in CLI:

  1. Check for a new possible sources file: PhLTemplateSourcesUpdateChecker uniqueInstance check.. It will fetch a sources.list.dl file and compare it againts the sources.listfile. If they are different, a PhLSourcesFileUpdateAvailableannoucement is announced. PhLTemplateSourcesUpdateChecker listen to this announcement and will trigger: PhLTemplateSourcesUpdateChecker>>#updateTemplateSources:.
  2. Probably PhLTemplateSourcesUpdateChecker should be updated to better handle both UI and CLI update because we have refererences to PharoLauncherApplication in the code
updateTemplateSources: announcement
	PharoLauncherApplication default shouldUpdateTemplateSources ifFalse: [ ^ self ].
	self basicUpdateTemplateSources

basicUpdateTemplateSources
	PhLPharoTemplateSources fromFile updateSourcesFile.
	PharoLauncherApplication resetTemplateRepository.
	PharoLauncherApplication default resetTemplateRepository.
  • PharoLauncherApplication default shouldUpdateTemplateSources ifFalse: [ ^ self ]. should be updated to do not reference directly the PharoLauncherApplication. Then we could either ask the update confirmation with a spec dialog (UI) or in the console (CLI)

@Bajger
Copy link
Member Author

Bajger commented Jan 23, 2024

PharoLauncherApplication default shouldUpdateTemplateSources ifFalse: [ ^ self ]. should be updated to do not reference directly the PharoLauncherApplication.

This is because to get rid of dependency / separation of business logic and UI?

Then we could either ask the update confirmation with a spec dialog (UI) or in the console (CLI)

Do we want to have interactive confirmation (Y/N) also in CLI? Or you mean non interactive (proceed with update will be always Yes).

@Bajger
Copy link
Member Author

Bajger commented Jan 23, 2024

One other catchup: I think there is something wrong with update checker, I've worked on P11 image with loaded dev branch of PharoLauncher and it freezes after restart of image. I think it is related to template update checker. Maybe to report in separate issue?
image

Update: Reported additional issue: #658

demarey added a commit that referenced this issue Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants