Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 39d85da

Browse files
authored
Merge pull request magento-commerce/devdocs#3230
Update the migration log generator
2 parents 8465701 + 365b358 commit 39d85da

File tree

1,402 files changed

+1424
-1415
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,402 files changed

+1424
-1415
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,4 @@ _algolia_api_key
2727

2828
/src/mbi/
2929
/src/page-builder/
30-
/src/page-builder-migration/
31-
/src/guides/m1x/
3230
/src/mftf/

_plugins/generators/migrated_log.rb

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44
# See COPYING.txt for license details.
55

66
# This plugin generates the page that contains a list of migrated topics: https://devdocs.magento.com/migrated.html
7-
# Also, it adds global data:
7+
# It adds global data:
88
# - site.data.migration.migrated_pages
99
# - site.data.migration.deprecated_pages
1010
# - site.data.migration.all_migrating_pages
1111
# - site.data.migration.remained_migrating_pages
1212
#
13+
# And generates the `tmp/migrated-from-to.csv` file with the list of links "from" and "to" for the migrated pages.
14+
# To enable the file generation, add 'migrated_log: generate_file' to _config.local.yml.
15+
#
1316

1417
module Jekyll
1518
# Custom generator for MRG pages
@@ -19,14 +22,21 @@ class MigratedLog < Generator
1922
def generate(site)
2023
@site = site
2124
pages = @site.pages
22-
migrated_pages = pages.select { |page| page.data['layout']&.include? 'migrated' }
25+
migrated_pages = pages.select { |page| page.data['status']&.include? 'migrated' }
2326
v2_3_pages = pages.select { |page| page.data['guide_version'] == '2.3' }
2427
remained_pages = pages - v2_3_pages
25-
deprecated_pages = remained_pages.select { |page| page.data['group'].nil? || page.data['redirect_to'] }
28+
deprecated_pages = remained_pages.select { |page| page.data['group'].nil? || (page.data['redirect_to'] && !page.data['status']) }
2629
all_migrating_pages = remained_pages - deprecated_pages
2730
remained_migrating_pages = all_migrating_pages - migrated_pages
2831
migrated_pages_data = []
2932

33+
if (site.config['migrated_log']&.include? 'generate_file')
34+
# Create a CSV file that contains links 'from' and 'to' for migrated pages
35+
migrated_pages = pages.select { |pages| pages.data['status']&.include? 'migrated' }
36+
redirects = migrated_pages.map { |page| "https://devdocs.magento.com#{page.data['redirect']['from']},#{page.data['redirect']['to']}" }
37+
File.write('tmp/migrated-from-to.csv', redirects.join("\n"))
38+
end
39+
3040
# Create an array of JSON objects that contain metadata for migrated pages
3141
migrated_pages.each do |page|
3242
migrated_page = {
@@ -39,27 +49,27 @@ def generate(site)
3949
'label') || abort("Error in '#{page.path}'.\n Check 'group' in the file's frontmatter or 'label' in the corresponding TOC.".red)
4050
end,
4151
migrated_from: site.baseurl + page.url,
42-
migrated_to: page.data['migrated_to'] || abort("Error in '#{page.path}'.\n Check 'migrated_to' in the file's frontmatter.".red),
43-
migrated_to_source: if page.data['migrated_to'].start_with?('https://experienceleague.adobe.com')
44-
'Adobe Experience League'
45-
elsif page.data['migrated_to'].start_with?('https://developer.adobe.com')
46-
'Adobe Developer'
47-
else
48-
abort "Error in '#{page.path}'.\nThe 'migrated_to' parameter in the front matter points to the wrong domain: #{page.data['migrated_to']}.\nShould be 'https://experienceleague.adobe.com' or 'https://developer.adobe.com'".red
49-
end
52+
redirected_to: page.data['redirect_to'] || abort("Error in '#{page.path}'.\n Check 'redirect_to' in the file's frontmatter.".red),
53+
redirected_to_source: if page.data['redirect_to'].start_with?('https://experienceleague.adobe.com')
54+
'Adobe Experience League'
55+
elsif page.data['redirect_to'].start_with?('https://developer.adobe.com')
56+
'Adobe Developer'
57+
else
58+
abort "Error in '#{page.path}'.\nThe 'redirected_to' parameter in the front matter points to the wrong domain: #{page.data['redirect_to']}.\nShould be 'https://experienceleague.adobe.com' or 'https://developer.adobe.com'".red
59+
end
5060
}
5161
migrated_pages_data << migrated_page
5262
end
5363

5464
# Group migrated pages by guide
5565
migrated_pages_by_group = migrated_pages_data.group_by { |page| page[:guide] }.sort.to_h
5666
# Introductory text in the Migrated topics page
57-
content = "The folowing #{migrated_pages.size} topics out of #{all_migrating_pages.size} have been migrated and will be redirected soon.\n\n"
67+
content = "The following #{migrated_pages.size} topics have been migrated and redirected.\n\n"
5868
migrated_pages_by_group.each do |guide, topics|
5969
content += "\n## #{guide}\n\n\n"
6070
topics.sort_by { |topic| topic[:title] }
6171
.each do |topic|
62-
content += "1. [#{topic[:title]}](#{topic[:migrated_from]}) has moved to [#{topic[:migrated_to_source]}](#{topic[:migrated_to]})\n"
72+
content += "1. [#{topic[:title]}](#{topic[:migrated_from]}) has moved to [#{topic[:redirected_to_source]}](#{topic[:redirected_to]})\n"
6373
end
6474
end
6575

src/catalog-service/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ group: catalog-service
33
title: Catalog Service for Adobe Commerce
44
ee_only: True
55
redirect_to: https://experienceleague.adobe.com/docs/commerce-merchant-services/catalog-service/overview.html
6-
layout: migrated
6+
status: migrated
77
---
88

99
Catalog Service uses GraphQL queries to provide rich view-model (read-only) catalog data to quickly and fully render product-related content on storefront, including product detail pages and product list pages. Catalog Service, along with [Live Search]({{site.baseurl}}/live-search/overview.html), each implement queries that return information that is not available to the [`products` query]({{site.baseurl}}/guides/v2.4/graphql/queries/products.html) on Adobe Commerce and Magento Open Source. For example, the Catalog Service [`products` query](products.html) treats all products as either simple or complex. Simple products have a single price, while complex products have a price range. The Live Search [`productSearch` query](../live-search/product-search.html) returns detailed facet information.

src/catalog-service/products.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ group: catalog-service
33
title: products query
44
ee_only: True
55
redirect_to: https://developer.adobe.com/commerce/webapi/graphql/schema/catalog-service/queries/products/
6-
layout: migrated
6+
status: migrated
77
---
88

99
The Catalog Service for Adobe Commerce `products` query returns details about the SKUs specified as input. Although this query has the same name as the [`products` query]({{site.baseurl}}/guides/v2.4/graphql/queries/products.html) that is provided with core Adobe Commerce and Magento Open Source, there are some differences.

src/catalog-service/productsearch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ group: catalog-service
33
title: productSearch query
44
ee_only: True
55
redirect_to: https://developer.adobe.com/commerce/webapi/graphql/schema/catalog-service/queries/product-search/
6-
layout: migrated
6+
status: migrated
77
---
88

99
The Catalog Service for Adobe Commerce `productSearch` query can use LiveSearch to return details about the SKUs specified as input. Although this query is the same as the [`productSearch` query]({{site.baseurl}}/live-search/product-search.html), LiveSearch returns a `productView` object. See the [`productSearch` query]({{site.baseurl}}/live-search/product-search.html) topic for reference information.

src/catalog-service/refine-product.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ group: catalog-service
33
title: refineProduct query
44
ee_only: True
55
redirect_to: https://developer.adobe.com/commerce/webapi/graphql/schema/catalog-service/queries/refine-product/
6-
layout: migrated
6+
status: migrated
77
---
88

99
The `refineProduct` query narrows the results of a `products` query that was run against a complex product. Before you run the `refineProduct` query, you must run the `products` query and construct the response so that it returns a list of `options` within a `ComplexProductView` inline fragment. When a shopper selects a product option (such as size or color) on the storefront, run the `refineProduct` query, specifying the SKU and selected option value IDs as input. Depending on the number of product options the complex product has, you might need to run the `refineProduct` query multiple times, until the shopper has selected a specific variant.

src/cloud/architecture/cloud-architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ functional_areas:
66
redirect_from:
77
- /cloud/basic-information/cloud-plans.html
88
redirect_to: https://experienceleague.adobe.com/docs/commerce-cloud-service/user-guide/architecture/cloud-architecture.html
9-
layout: migrated
9+
status: migrated
1010
---
1111

1212
{{site.data.var.ece}} has a Starter and a Pro plan. Each plan has a unique architecture to drive your {{site.data.var.ee}} development and deployment process. Both the Starter plan and the Pro plan architecture deploy databases, web server, and caching servers across multiple environments for end-to-end testing while supporting continuous integration.

src/cloud/architecture/pro-architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ redirect_from:
88
functional_areas:
99
- Cloud
1010
redirect_to: https://experienceleague.adobe.com/docs/commerce-cloud-service/user-guide/architecture/pro-architecture.html
11-
layout: migrated
11+
status: migrated
1212
---
1313

1414
Your {{site.data.var.ece}} Pro architecture supports multiple environments that you can use to develop, test, and launch your store.

src/cloud/architecture/pro-develop-deploy-workflow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ redirect_from:
88
functional_areas:
99
- Cloud
1010
redirect_to: https://experienceleague.adobe.com/docs/commerce-cloud-service/user-guide/architecture/pro-develop-deploy-workflow.html
11-
layout: migrated
11+
status: migrated
1212
---
1313

1414
The {{site.data.var.ece}} Pro plan includes a single Git repository with a Global Master and three main environments: the **Integration** environment for development and testing, the **Staging** environment for testing with all services, and the **Production** environment for launching and maintaining your live site. See [Pro architecture]({{ site.baseurl }}/cloud/architecture/pro-architecture.html) for an overview.

src/cloud/architecture/scaled-architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Scaled architecture
44
functional_areas:
55
- Cloud
66
redirect_to: https://experienceleague.adobe.com/docs/commerce-cloud-service/user-guide/architecture/scaled-architecture.html
7-
layout: migrated
7+
status: migrated
88
---
99

1010
The Cloud infrastructure scales according to your resource needs to achieve greater efficiency. The {{site.data.var.ece}} monitors your applications and can adjust capacity to maintain steady, predictable performance. Converting to this architecture helps to mitigate problems, such as latency or large spikes in traffic.

0 commit comments

Comments
 (0)