Skip to content

[Bugfix:System] Fix PHP 8.2 Migrator#12672

Merged
bmcutler merged 1 commit into
mainfrom
fix-php8.2-migrator
Mar 27, 2026
Merged

[Bugfix:System] Fix PHP 8.2 Migrator#12672
bmcutler merged 1 commit into
mainfrom
fix-php8.2-migrator

Conversation

@Eli-J-Schwartz

Copy link
Copy Markdown
Contributor

Why is this Change Important & Necessary?

Fixes #12667.

What is the New Behavior?

Before: Migrator fails if apt is not up to date, and completely uninstalls PHP

Screenshot_20260327_162324

After: Migrator succeeds, php still exists after submitty_install

Screenshot_20260327_164407

What steps should a reviewer take to reproduce or test the bug or new feature?

  1. Load an old vagrant box of the Submitty vm (e.g. 25.12.00.2512070428. This is needed to intentionally make the package list metadata in apt out of date, which triggers the error. (vagrant box add SubmittyBot/ubuntu22-dev --box-version 25.12.00.2512070428)
  2. Run: vagrant up; vagrant ssh; submitty_install.
  3. See if the installation succeeded or not
  4. Run php -v to see if php exists and what version it is. If the command fails, php is no longer installed. This should never happen with this PR's changes.

Automated Testing & Documentation

None

Other information

If the migration has already been run, and the system is working normally, it does not need to be run again; the migration system should do this automatically. If the migration has not yet been run, it should be run with the changes here.

Perhaps we should add sudo apt-get update to submitty_install, but that would be another PR.

@codecov

codecov Bot commented Mar 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 21.64%. Comparing base (9e1a364) to head (bce5a57).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##               main   #12672   +/-   ##
=========================================
  Coverage     21.64%   21.64%           
  Complexity     9654     9654           
=========================================
  Files           268      268           
  Lines         36245    36245           
  Branches        487      487           
=========================================
  Hits           7846     7846           
  Misses        27916    27916           
  Partials        483      483           
Flag Coverage Δ
autograder 21.32% <ø> (ø)
js 2.04% <ø> (ø)
migrator 100.00% <ø> (ø)
php 20.66% <ø> (ø)
python_submitty_utils 80.08% <ø> (ø)
submitty_daemon_jobs 91.13% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bmcutler
bmcutler merged commit aa3b0e9 into main Mar 27, 2026
26 of 27 checks passed
@bmcutler
bmcutler deleted the fix-php8.2-migrator branch March 27, 2026 21:04
@github-project-automation github-project-automation Bot moved this from Seeking Reviewer to Done in Submitty Development Mar 27, 2026
GarvitKhandelwal31 pushed a commit to GarvitKhandelwal31/Submitty that referenced this pull request Mar 29, 2026
### Why is this Change Important & Necessary?
Fixes Submitty#12667.

### What is the New Behavior?
Before: Migrator fails if apt is not up to date, and completely
uninstalls PHP

<img width="1440" height="900" alt="Screenshot_20260327_162324"
src="https://github.com/user-attachments/assets/c4f158d4-edd1-4257-ae07-42859ea2ea1a"
/>

After: Migrator succeeds, php still exists after `submitty_install`

<img width="1440" height="900" alt="Screenshot_20260327_164407"
src="https://github.com/user-attachments/assets/4407473b-2f94-4fce-b5ca-47610c09fbad"
/>

### What steps should a reviewer take to reproduce or test the bug or
new feature?
1. Load an old vagrant box of the Submitty vm (e.g.
[25.12.00.2512070428](https://portal.cloud.hashicorp.com/vagrant/discover/SubmittyBot/ubuntu22-dev/versions/25.12.00.2512070428).
This is needed to intentionally make the package list metadata in apt
out of date, which triggers the error. (`vagrant box add
SubmittyBot/ubuntu22-dev --box-version 25.12.00.2512070428`)
2. Run: `vagrant up; vagrant ssh; submitty_install`.
3. See if the installation succeeded or not
4. Run `php -v` to see if php exists and what version it is. If the
command fails, php is no longer installed. This should never happen with
this PR's changes.

### Automated Testing & Documentation
None

### Other information
If the migration has already been run, and the system is working
normally, it does not need to be run again; the migration system should
do this automatically. If the migration has not yet been run, it should
be run with the changes here.

Perhaps we should add `sudo apt-get update` to `submitty_install`, but
that would be another PR.
GarvitKhandelwal31 pushed a commit to GarvitKhandelwal31/Submitty that referenced this pull request Apr 14, 2026
### Why is this Change Important & Necessary?
Fixes Submitty#12667.

### What is the New Behavior?
Before: Migrator fails if apt is not up to date, and completely
uninstalls PHP

<img width="1440" height="900" alt="Screenshot_20260327_162324"
src="https://github.com/user-attachments/assets/c4f158d4-edd1-4257-ae07-42859ea2ea1a"
/>

After: Migrator succeeds, php still exists after `submitty_install`

<img width="1440" height="900" alt="Screenshot_20260327_164407"
src="https://github.com/user-attachments/assets/4407473b-2f94-4fce-b5ca-47610c09fbad"
/>

### What steps should a reviewer take to reproduce or test the bug or
new feature?
1. Load an old vagrant box of the Submitty vm (e.g.
[25.12.00.2512070428](https://portal.cloud.hashicorp.com/vagrant/discover/SubmittyBot/ubuntu22-dev/versions/25.12.00.2512070428).
This is needed to intentionally make the package list metadata in apt
out of date, which triggers the error. (`vagrant box add
SubmittyBot/ubuntu22-dev --box-version 25.12.00.2512070428`)
2. Run: `vagrant up; vagrant ssh; submitty_install`.
3. See if the installation succeeded or not
4. Run `php -v` to see if php exists and what version it is. If the
command fails, php is no longer installed. This should never happen with
this PR's changes.

### Automated Testing & Documentation
None

### Other information
If the migration has already been run, and the system is working
normally, it does not need to be run again; the migration system should
do this automatically. If the migration has not yet been run, it should
be run with the changes here.

Perhaps we should add `sudo apt-get update` to `submitty_install`, but
that would be another PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

PHP 8.2 Migration Doesn't Fetch Before Installing

2 participants