Skip to content

Store Tracking URL in DB as well as Tracking Code #10799

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

Closed
wants to merge 3 commits into from
Closed

Store Tracking URL in DB as well as Tracking Code #10799

wants to merge 3 commits into from

Conversation

RhodriOwainDavies
Copy link

@RhodriOwainDavies RhodriOwainDavies commented Sep 6, 2017

Please beware this is critical for Magento Shipping (to be released in v2.2.2 - discuss with @joni-jones @orlangur & Nadia Kalinovich

Linked to #10977

Forked from 2.2-develop branch, merge target branch 2.2-develop as per @joni-jones 's request.

Description

Add a new field sales_shipment_track.track_url.
Expose this field via API.
Including this URL as a hyperlink in the Shipment Sent Email template.

Feature

To support impending Magento Shipping feature request of inserting Carrier Specific URL in email template to Customer

Manual testing scenarios

  1. API Test
    POST /V1/order/{orderId}/ship
    Pass in tracking_url as an extension attribute (in same manner as tracking_number)
  2. UI Test
    In the admin section, view a Shipment which already has a trackinging URL set (via API in Test Can you commit to repository a folder dev/tests/static ? #1). Click Send Tracking Email. Check email, Tracking Number should be a hyperlink to tracking_url

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Sep 6, 2017

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 3 committers have signed the CLA.

✅ RhodriOwainDavies
❌ paliarush
❌ viktym

@RhodriOwainDavies RhodriOwainDavies changed the title Store Tracking URL in DB as well as Tracking Code WIP : Store Tracking URL in DB as well as Tracking Code Sep 7, 2017
* @param string $trackUrl
* @return $this
*/
public function setTrackUrl($trackUrl);
Copy link
Contributor

Choose a reason for hiding this comment

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

New methods cannot be added into existing @api interfaces as it will break every existing interface implementation. Please check http://devdocs.magento.com/guides/v2.0/contributor-guide/backward-compatible-development/#introduction-of-a-method-to-a-class-or-interface

@@ -55,6 +55,15 @@ public function testSetGetNumber()
$this->assertEquals('test', $this->_model->getTrackNumber());
}

public function testSetGetUrl()
Copy link
Contributor

Choose a reason for hiding this comment

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

This test method is useless.

@@ -41,14 +41,17 @@ public function testGetList()
$filter3 = $filterBuilder->setField(ShipmentTrackInterface::TRACK_NUMBER)
->setValue('track number 4')
->create();
$filter4 = $filterBuilder->setField(ShipmentTrackInterface::CARRIER_CODE)
->setValue('carrier code 5')
$filter4 = $filterBuilder->setField(ShipmentTrackInterface::TRACK_URL)
Copy link
Contributor

@YevSent YevSent Sep 7, 2017

Choose a reason for hiding this comment

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

You added new search criteria but didn't change the test's fixture. Seems these changes cause travis failures. Does this test work as expected in your environment?

Copy link
Author

Choose a reason for hiding this comment

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

Hi, I've updated the tests again, including the fixtures, please check again

Copy link
Contributor

Choose a reason for hiding this comment

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

Confirmed.

/**
* Shipment Track Creation interface.
*/
interface TrackUrlInterface
Copy link
Contributor

Choose a reason for hiding this comment

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

Introduction of the new interface should bump the minor version of a package.

Copy link
Author

Choose a reason for hiding this comment

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

I've bumped the version number

Copy link
Contributor

Choose a reason for hiding this comment

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

Do not see any changes in composer.json file.

Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

You need to bump the version of composer.json in Sales module and specify the updated version in the replace section of "root" composer.json file. Also TrackUrlInterface should be marked as API.

Copy link
Contributor

@orlangur orlangur Sep 11, 2017

Choose a reason for hiding this comment

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

need to bump the version of composer.json in Sales module and specify the updated version in the replace section of "root" composer.json file

Would be nice if such info added to http://devdocs.magento.com/guides/v2.0/contributor-guide/backward-compatible-development/ or http://devdocs.magento.com/guides/v2.2/extension-dev-guide/versioning/

@RhodriOwainDavies RhodriOwainDavies changed the title WIP : Store Tracking URL in DB as well as Tracking Code Store Tracking URL in DB as well as Tracking Code Sep 8, 2017
@RhodriOwainDavies RhodriOwainDavies changed the title Store Tracking URL in DB as well as Tracking Code WIP : Store Tracking URL in DB as well as Tracking Code Sep 12, 2017
composer.json Outdated
@@ -86,122 +86,121 @@
"sebastian/phpcpd": "2.0.4"
},
"replace": {
Copy link
Author

Choose a reason for hiding this comment

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

Hi @orlangur

Can you help me by providing me with a correct version of composer.json ?

I'm not sure what version each of the modules are supposed to be in the replace section. All I do know is that "magento/module-sales": "100.3.0-dev",

Copy link
Author

Choose a reason for hiding this comment

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

And can you confirm my target branch? My PR is currently targeting develop branch, whereas maybe it should be 2.2.0-preview

Copy link
Contributor

Choose a reason for hiding this comment

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

It should definitely be develop, please change back.

develop branch reflects what will be later released as 2.3, most of the modules are 100.3.0-dev so I assume your change makes module Sales 100.4.0-dev (@joni-jones, please check).

@RhodriOwainDavies RhodriOwainDavies changed the title WIP : Store Tracking URL in DB as well as Tracking Code Deprecated : Store Tracking URL in DB as well as Tracking Code Sep 13, 2017
@RhodriOwainDavies RhodriOwainDavies changed the title Deprecated : Store Tracking URL in DB as well as Tracking Code Store Tracking URL in DB as well as Tracking Code Sep 13, 2017
@RhodriOwainDavies RhodriOwainDavies changed the base branch from develop to 2.2.0-preview September 13, 2017 06:30
[mpi] MAGETWO-72551: Update version in composer to 2.2.1-dev for 2.2-develop branch
@RhodriOwainDavies RhodriOwainDavies changed the base branch from 2.2.0-preview to 2.2-develop September 20, 2017 00:44
@orlangur
Copy link
Contributor

@RhodriOwainDavies changed the base branch from 2.2.0-preview to 2.2-develop

develop branch shall be used here, not 2.2-develop. After PR is merged into develop, backport to 2.2-develop could be created.

@RhodriOwainDavies
Copy link
Author

RhodriOwainDavies commented Sep 20, 2017

Hi @orlangur

Please refer to message from @joni-jones

Please use 2.2-develop to deliver code for upcoming 2.2.x releases.

@orlangur
Copy link
Contributor

orlangur commented Sep 20, 2017

It is misleading, see https://community.magento.com/t5/Magento-DevBlog/Pull-Requests-for-2-1-x-Patch-Releases/ba-p/65630 for details. The same rules apply for 2.2-develop: changes must be applied to develop first.

@joni-jones please confirm.

@RhodriOwainDavies RhodriOwainDavies changed the base branch from 2.2-develop to develop September 20, 2017 12:11
@RhodriOwainDavies RhodriOwainDavies changed the base branch from develop to 2.2-develop September 20, 2017 12:13
@RhodriOwainDavies
Copy link
Author

I used 2.2-develop as a base, so a PR into develop will result in many changed files (237 files changed).

  1. Please confirm which branch I should start with

I'll go ahead and make my changes on top of that branch

  1. Please confirm which branch(es) I should target in my Pull Request(s)

Please bear in mind this is a feature requirement for the upcoming Magento Shipping module (currently scheduled for v2.2.2).

@orlangur
Copy link
Contributor

this is a feature requirement for the upcoming Magento Shipping module (currently scheduled for v2.2.2)

Where do you get such information by the way? I didn't contact Nadia but by myself didn't hear it yet.

I used 2.2-develop as a base, so a PR into develop will result in many changed files (237 files changed).

You need to apply your commits on top of develop or wait while 2.2-develop will be merged again into develop and then merge develop into your branch.

@RhodriOwainDavies
Copy link
Author

Hi @orlangur

I've been working closely with Nadia and the Magento Shipping team on the solution and we have targeted v2.2.2 for release. Please discuss directly with Nadia for further info.

I've updated this PR and created a new PR here:
10977

Hope they're ok, please let me know.

@vrann vrann added 2.2.x improvement Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Award: complex labels Sep 26, 2017
@vrann vrann self-assigned this Sep 28, 2017
@vrann vrann reopened this Sep 29, 2017
@vrann
Copy link
Contributor

vrann commented Oct 4, 2017

Please see comments here #10977

@vrann
Copy link
Contributor

vrann commented Oct 11, 2017

@RhodriOwainDavies discussed with @antonkril today, this change cannot be released in 2.2 as backward incompatible. Please re-create the PR for develop branch

@vrann vrann closed this Oct 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Award: complex improvement Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants