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

Bug 🐞: Lecture creation and last modified dates incorrect #38

Open
KL13NT opened this issue Jan 21, 2023 · 5 comments
Open

Bug 🐞: Lecture creation and last modified dates incorrect #38

KL13NT opened this issue Jan 21, 2023 · 5 comments
Assignees
Labels
bug Something isn't working scope: template Regarding the nextjs template repo

Comments

@KL13NT
Copy link
Owner

KL13NT commented Jan 21, 2023

Describe the bug
Git doesn't store file metadata. The action doesn't have access to the original file system. When it builds, it checks out the content repo. During this checkout process Git creates the files and sets their stat dates to the current moment, not the original, which causes the template to render dates wrong.

Expected behavior
The template should work with correct dates.

Possible fix
Use nodegit to fetch last commit for each document and get the date of that last modification, as well as the first commit the file was created in.

@KL13NT KL13NT added bug Something isn't working scope: template Regarding the nextjs template repo labels Jan 21, 2023
@KL13NT KL13NT self-assigned this Jan 21, 2023
@KL13NT
Copy link
Owner Author

KL13NT commented Jan 21, 2023

@KL13NT KL13NT closed this as completed Jan 21, 2023
@KL13NT
Copy link
Owner Author

KL13NT commented Jan 21, 2023

Reopening this since I reverted the commit. node-gyp seems to crash when building the example repo and I haven no idea why. I'll keep this open until I can figure it out.

@KL13NT KL13NT reopened this Jan 21, 2023
@KL13NT
Copy link
Owner Author

KL13NT commented Jan 21, 2023

This seems like a possible fix:
nodegit/nodegit#1840 (comment)

@KL13NT
Copy link
Owner Author

KL13NT commented Jan 22, 2023

Okay I just tried installing the dependencies nodegit requires and everything seems fine so far. I'll try again later with npm package cache (with cache-key set to cac.config + build.yml in example repo.

@KL13NT
Copy link
Owner Author

KL13NT commented Jan 23, 2023

The time cost of installing nodegit is around 6 mins. I should test with npm cache.

If it remains slow either way I think removing all unused functionality and native binds may fix it. Not sure tho.

@KL13NT KL13NT moved this to 🆕 New in Courseware as Code Jan 23, 2023
@KL13NT KL13NT moved this from 🆕 New to 📋 Backlog in Courseware as Code Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working scope: template Regarding the nextjs template repo
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant