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

Maintenance: use the correct object directory #470

Merged
merged 6 commits into from
Dec 17, 2020

Conversation

derrickstolee
Copy link
Contributor

In #458, we dropped the Scalar.Service application from the macOS platform and depended entirely on git maintenance start to initialize background maintenance. This had two issues:

  1. The cron-based background maintenance does not sufficiently create a user environment for GCM Core to store credentials. This causes it to start loading pop-ups on the hour every hour for the prefetch task. This item is handled upstream as ds/maintenance-part-4, which creates platform-specific maintenance abilities, including macOS integration with launchd/launchctl.
  2. The maintenance jobs don't look at the shared object cache! While we were depending on git maintenance run --task=<task> inside scalar run <job>, I forgot that scalar run sets GIT_OBJECT_DIRECTORY so something inside of git maintenance run needs to do the same. This is being answered by Update 'git maintenance' to match upstream git#301.

As for Scalar, the only thing we need to do is consume this new version of Git and test that git maintenance run does the same thing as scalar run. Hold it to the same standards.

Review commit-by-commit to avoid being overwhelmed with scaffolding for the multi-mode test classes.

This allows running the same tests in both "scalar run" and "git
maintenance run" modes. The actual logic based on this bit of
information is not actually included yet.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
To check if Git's official background maintenance is ready for
a full Scalar repo, add tests that check for how 'git maintenance
run --task=loose-objects' compare to 'scalar run loose-objects'.

The biggest difference is that 'scalar run <task>' sets
GIT_OBJECT_DIRECTORY to the shared object cache before running
'git maintenance run --task=<task>', so we need to make Git do that,
too.

THIS COMMIT CAUSES FUNCTIONAL TEST FAILURES. These will be fixed in
the next commit.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
This change works without a hitch.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Switch based on the test harness to use 'git maintenance run' as
well as 'scalar run' for the commit-graph task.

The one clear deviation is that we cannot have Git clean up the
.lock file, since that violates Git's expectations. That's a
meaningful behavior difference (that hopefully won't matter?) so
let's attempt to fix that problem.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Use the 'git maintenance run --task=prefetch' the same was as
'scalar run fetch' to maximize our test coverage.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
See microsoft/git#301.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
@derrickstolee derrickstolee changed the title [PR Build] Maintenance: use the correct object directory Maintenance: use the correct object directory Dec 15, 2020
@derrickstolee derrickstolee marked this pull request as ready for review December 15, 2020 14:36
Copy link
Member

@mjcheetham mjcheetham left a comment

Choose a reason for hiding this comment

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

This looks good to me

@derrickstolee derrickstolee merged commit ab4cb97 into microsoft:main Dec 17, 2020
Copy link
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

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

Not an expert, just two small comments/questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants