Skip to content

New: postinstall script added to allow older courses to be migrated in the authoring tool (fixes #42)#43

Closed
joe-allen-89 wants to merge 1 commit into
masterfrom
issue/42
Closed

New: postinstall script added to allow older courses to be migrated in the authoring tool (fixes #42)#43
joe-allen-89 wants to merge 1 commit into
masterfrom
issue/42

Conversation

@joe-allen-89
Copy link
Copy Markdown
Contributor

#42

New:

Copy link
Copy Markdown
Member

@taylortom taylortom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me 🎉

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

@oliverfoster
Copy link
Copy Markdown
Member

oliverfoster commented Mar 31, 2025

I don't understand the process for having it patch grunt in adapt_framework in an AAT. Could you explain please? (And add said instructions to the readme)

@joe-allen-89
Copy link
Copy Markdown
Contributor Author

I don't understand the process for having it patch grunt in adapt_framework in an AAT. Could you explain please? (And add said instructions to the readme)

The way we have it working on import is to install adapt-migrations and run the task within the imported course, the issue was when migrating an older course the grunt task itself is missing from the course being imported, so this will copy the task into the course being imported (if missing) to allow it to run.

@oliverfoster
Copy link
Copy Markdown
Member

The way we have it working on import is to install adapt-migrations

Who or what installs adapt-migrations and where do they install it?

@joe-allen-89
Copy link
Copy Markdown
Contributor Author

The way we have it working on import is to install adapt-migrations

Who or what installs adapt-migrations and where do they install it?

Installed inside the course being imported, on import not manually.

@oliverfoster
Copy link
Copy Markdown
Member

So the AAT programmatically installs adapt-migrations into the framework as part of the import, and then adapt-migrations updates the grunt task folder from its example/ folder as an npm post install script?

@joe-allen-89
Copy link
Copy Markdown
Contributor Author

So the AAT programmatically installs adapt-migrations into the framework as part of the import, and then adapt-migrations updates the grunt task folder from its example/ folder as an npm post install script?

It doesn't update the grunt task if it's already there, but will copy it across if it's missing, but yes that's the process.

@oliverfoster
Copy link
Copy Markdown
Member

oliverfoster commented Apr 2, 2025

tldr: It would be better to be able to run the grunt task from the to-framework on the from-framework source.

Long version

I'm assuming there will be two copies of the framework in the import process; the from-framework and the to-framework.

This pr will make at least two copies of grunt/tasks/migration.js that will be executed together in the import process; one copy at adapt-migrations/examples/migration.js and the various versions of adapt_framework@version/grunt/tasks/migration.js in the from-frameworks and to-frameworks. Any changes made to the adapt_framework version will need to be made to the adapt-migrations version, but the adapt-migrations version will need to be modified to be backward compatible for all of the possible from-framework versions in which it will be executed.

Having the AAT specifically modify the from-framework will break if the structure of the from-framework changes in a breaking way in the future, consequently the adapt_framework, the AAT and adapt-migrations will all need appropriately modifying at each breaking change to adapt_framework. That is to say, by doing this we have three independent bodies of code whose responsibilities have been smudged together in a very tightly coupled way.

The to-framework will have its own copy of the grunt/tasks/migration.js, it would make more sense to leave that single copy of grunt/tasks/migration.js where it is and not to duplicate it.

There are two parts to the to-framework and the from-framework: the plugins and the course-data. It is currently possible to run the migrations task against any course-data folder by specifying the course-data path at the command-line argument --outputdir=[path] as can be seen in the use of Helpers.getFramework at these lines in the migration task. If you could also specify the location of the from plugins path and the location of the capture path as command-line arguments, then it would be possible to use the existing to-framework grunt task on the from-framework plugins and on the from-framework course-data and to output the capture folder to any location, without needing an extra install step in the AAT or a second copy of migration.js in adapt-migrations or a post install script.

Note: The migrations/ folder does need access to the node_modules/adapt-migrations library, so it should be created only next to where that exists.

@oliverfoster
Copy link
Copy Markdown
Member

Pr for above here adaptlearning/adapt_framework#3668

@joe-allen-89
Copy link
Copy Markdown
Contributor Author

Pr for above here adaptlearning/adapt_framework#3668

Closing due to framework update meaning postinstall is not required.

@github-project-automation github-project-automation Bot moved this from Needs Reviewing to Recently Released in adapt_framework: The TODO Board Apr 14, 2025
@taylortom taylortom deleted the issue/42 branch April 22, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

migration scripts missing from old versions of framework causing a grunt error

4 participants