Skip to content

Commit

Permalink
Use the Identity_Crisis package (#19126)
Browse files Browse the repository at this point in the history
* Initial skeleton for the Identity_Crisis package.
Including the basic file and class structures for now.

* Adding the initial version of the Identity_Crisis class copied from the Jetpack_IDC class.
A lot of the code has been massaged/fixed to pass the phpcs checks.

* Finally getting some of the dependencies resolved.
The phpunit tests will actually run now.

* Resolving the remaining Jetpack class dependencies.
The methods used have all been copied to the Identity_Crisis class.

* Updating the readme's usage section.

* Making some changes to use the new Identity_Crisis package.
Removing the old Jetpack_IDC class.

* Adding the password-checker package back after rebase.

* removing the identity-crisis package so that I can rebase.

* Adding the identity-crisis package back after rebase.

* Adding changelog entry.

* Adding the changelogger package.

* Adding changelog entry.

* Removing the identity-crisis package directory.
Should avoid a merge confict later on.

* Removing the identity-crisis package so that I can rebase.

* Adding changelog entry

* Adding the identity-crisis package back after rebase.

* Adding the idc-notice.js asset.

* Adding tooling to handle building assets.

* Adding a few other files I missed in the last commit.

* Bumping the node version to 14.
Adding the identity-crisis package to the Monorepo packages ignore list.

* Building JS.

* Adding the CSS assets.

* Building SCSS

* Adjust enqueueing of the built assets.

* Adding CSS assets for jetpack-idc-admin-bar and jetpack-idc-admin-bar-rtl.

* Adding the tracks-callables.js file to the Tracking package.
Related: Automattic/jetpack#15929

* Adding changelog entry.

* Adding the Tracking package.
Using the Tracking package's enqueue_tracks_scripts() method to handle the JS assets.

* Removing the calls to wp_register_script() for the tracks-callable.js file.
Removing the jp-tracks-functions slug from the array of script slugs.

* Adding changelog entry.

* Reverting the changes to class.jetpack.php.
It seems we'll still need to enqueue the scripts here.

* Adding the register_tracks_scripts() method.
This will handle calling the wp_register_script() function for the tracks-callables.js file.

In the class.jetpack.php file, replacing the call to the wp_register_script() function with the $tracking->register_tracks_scripts() method.

* Call the new register_tracks_scripts() method that will soon exist in the Tracking package.

* Calling the $tracking->register_tracks_scripts() method in the search widget.

* Register jp-tracks dependency when registering jp-tracks-functions.
Rename register function to destinguish it from the jptracks used in enqueue.
Update register function to static to not instantiate class.
Update dependencies to simplify only needed entries.

* Update changelogger entry so Jetpack has changelog entry.

* [not verified] Composer Updates to have dependency versions and meta as outlined by linting.
Identity Crisis class has PACKAGE_VERSION attribute
Update Identity Crisis to enqueue based on correct paths and versions.
js file updated to have jsdocs, and updated var to let and const as appropriate.
Webpack config updated to remove the polyfill that isn't required.
Deleted rtl file that is auto-generated.

* maintain current versions as we haven't switched to package aware

* Update the register function to optionally enqueue. Necessary when other packages rely on the script but shouldn't be aware of file location details.

* Update Sync Pakcage to have Identity_Crisis as a dependency.
Update Sync Configure to call Identity_Crisis init
Deprecation of Jetpack idc functions that are migrated to Identity Crisis package.
Update Jetpack references to Identity Crisis.

* Copy Admin.css to package (unblock Backup development.
add _color.scss and color.scss to compare tool to ensure they remain aligned.
composer version fix for wordbless.

* reverse conditional so more intuitive.

* Update references from Jetpack:: to Identity_Crisis for migrated methods.

* remove tracks-callables.js from previous location.

* remove migrated idc-notice.js file

* Updated version using tools/project-version.sh

* [not verified] Update dependency to proper versions.
maintain class.jetpack-idc.php to avoid fatals during upgrade routines.
Add proper use calls to files

* Migrate home_url and site_url into Identity Crisis package to break dependency cycle.

* remove Identity Crisis dependency on Sync. Migrate loading of IDC back to Jetpack.

* missed update to Identity_Crisis/Functions from Sync/Functions

* Fix typo and composer version.

* proper package name jetpack-*

* dependency updates to 1.22.x-dev for sync

* tools/check-composer-deps.sh -u

* Changelog update.

* Update Status reference to deprecated class

* Connection changelog

* Updated the function check not the reference.

* another round of dependency updates

* Sync tests updated to use Identity_Functions

* Another round of composer updates

* More version dependency updates.

* Changelog for jitm

* Remove link idc-notice.js from exclude list.

* update composer lock file

* bump composer lock

* Changelog

* Migrate url functions into the Utils class of the Connection Package.

* Missed update to callables, confirms our check for function exists is stopping fatals.

* Update readme with instructions on how to initialize Identity Crisis flows.

* Migration from Utils to Urls

* Undo escapes, add PHPCS
Update to use is_connected instead of deprecated is_active

* Updated lock file

* Missing use statement.

* Build Assets should use require to get the array with version information.

* Fix Build inclusion in mirror

* Update docblock

* remove contents of Jetpack_IDC class file

* Update projects/packages/connection/changelog/update-use-identity-crisis-package

Co-authored-by: Brad Jorsch <anomiex@users.noreply.github.com>

* Update projects/packages/identity-crisis/changelog/update-use-identity-crisis-package

Co-authored-by: Brad Jorsch <anomiex@users.noreply.github.com>

* Update projects/packages/sync/changelog/update-use-identity-crisis-package

Co-authored-by: Brad Jorsch <anomiex@users.noreply.github.com>

* Update projects/plugins/jetpack/class.jetpack.php

Co-authored-by: Brad Jorsch <anomiex@users.noreply.github.com>

* Update projects/plugins/jetpack/class.jetpack.php

Co-authored-by: Brad Jorsch <anomiex@users.noreply.github.com>

* Update projects/plugins/jetpack/class.jetpack.php

Co-authored-by: Brad Jorsch <anomiex@users.noreply.github.com>

* Update projects/packages/sync/src/class-functions.php

Co-authored-by: Brad Jorsch <anomiex@users.noreply.github.com>

* Update projects/packages/sync/src/class-functions.php

Co-authored-by: Brad Jorsch <anomiex@users.noreply.github.com>

* Update projects/packages/sync/src/class-functions.php

Co-authored-by: Brad Jorsch <anomiex@users.noreply.github.com>

* Update projects/packages/sync/src/class-functions.php

Co-authored-by: Brad Jorsch <anomiex@users.noreply.github.com>

* Update projects/packages/sync/src/class-functions.php

Co-authored-by: Brad Jorsch <anomiex@users.noreply.github.com>

* Update projects/packages/sync/src/class-functions.php

Co-authored-by: Brad Jorsch <anomiex@users.noreply.github.com>

* Update projects/packages/sync/src/class-functions.php

Co-authored-by: Brad Jorsch <anomiex@users.noreply.github.com>

* Update composer mismatch to 1.28.x-dev

* Update Connection 1.28 dependency and lock

* Version updates to connection 1.28

* Backup composer lock

* Changelog and lock file updates

Co-authored-by: Brad Jorsch <brad.jorsch@automattic.com>
Co-authored-by: Sergey Mitroshin <sergeymitr@gmail.com>
Co-authored-by: Brandon Kraft <public@brandonkraft.com>
Co-authored-by: Matthew Denton <matt@mdbitz.com>
Co-authored-by: Brad Jorsch <anomiex@users.noreply.github.com>

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/879621148
  • Loading branch information
mdbitz authored and matticbot committed May 26, 2021
1 parent 6b6d370 commit cc43496
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.8.0-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

### Changed
- Update callback to Jetpack to new Identity_Crisis class

## [1.7.6] - 2021-05-25
### Changed
- Updated package dependencies.
Expand Down Expand Up @@ -98,6 +105,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Packages: Introduce a status package

[1.8.0-alpha]: https://github.com/Automattic/jetpack-status/compare/v1.7.6...v1.8.0-alpha
[1.7.6]: https://github.com/Automattic/jetpack-status/compare/v1.7.5...v1.7.6
[1.7.5]: https://github.com/Automattic/jetpack-status/compare/v1.7.4...v1.7.5
[1.7.4]: https://github.com/Automattic/jetpack-status/compare/v1.7.3...v1.7.4
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"link-template": "https://github.com/Automattic/jetpack-status/compare/v${old}...v${new}"
},
"branch-alias": {
"dev-master": "1.7.x-dev"
"dev-master": "1.8.x-dev"
}
}
}
2 changes: 1 addition & 1 deletion src/class-status.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public function is_staging_site() {
}

// Last, let's check if sync is erroring due to an IDC. If so, set the site to staging mode.
if ( ! $is_staging && method_exists( 'Jetpack', 'validate_sync_error_idc_option' ) && \Jetpack::validate_sync_error_idc_option() ) {
if ( ! $is_staging && method_exists( 'Automattic\\Jetpack\\Identity_Crisis', 'validate_sync_error_idc_option' ) && \Automattic\Jetpack\Identity_Crisis::validate_sync_error_idc_option() ) {
$is_staging = true;
}

Expand Down

0 comments on commit cc43496

Please sign in to comment.