Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
yangyansong-adbe committed Sep 28, 2023
1 parent 1fceebe commit 9446966
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 26 deletions.
20 changes: 11 additions & 9 deletions .github/scripts/release_notes/android-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async function fetchMavenArtifactInfo(groupId, capacity, timestampInMilliseconds
let options = {
host: 'search.maven.org',
port: 443,
timeout: 2000,
timeout: 5000,
path: `/solrsearch/select?q=g:${groupId}&core=gav&rows=${capacity}&wt=json`,
method: 'GET',
headers: {
Expand Down Expand Up @@ -159,7 +159,7 @@ function buildGitHubInfo(artifactId, artifactVersion) {
case "signal":
return {
repoName: `aepsdk-${artifactId}-android`,
tagName: `${artifactVersion}-${artifactId}`
tagName: `v${artifactVersion}-${artifactId}`
}

case "edge":
Expand All @@ -179,13 +179,15 @@ function buildGitHubInfo(artifactId, artifactVersion) {
repoName: `aepsdk-${artifactId}-android`,
tagName: `v${artifactVersion}`
}
case "messaging":
case "campaignclassic":
case "campaign":
return {
repoName: `aepsdk-${artifactId}-android`,
tagName: artifactVersion
}

// TODO: remove the following code after the tag name is updated
// case "messaging":
// case "campaignclassic":
// case "campaign":
// return {
// repoName: `aepsdk-${artifactId}-android`,
// tagName: artifactVersion
// }
default:
console.log("artifactId not supported: " + artifactId)
return null
Expand Down
9 changes: 7 additions & 2 deletions .github/scripts/release_notes/github-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async function fetchReleaseInfo(token, owner, repo, capacity = 5) {
let options = {
host: 'api.github.com',
port: 443,
timeout: 2000,
timeout: 5000,
path: `/repos/${owner}/${repo}/releases?per_page=${capacity}`,
method: 'GET',
headers: {
Expand Down Expand Up @@ -83,6 +83,7 @@ async function fetchReleaseInfoWithTagName(token, owner, repo, tag) {
let options = {
host: 'api.github.com',
port: 443,
timeout: 5000,
path: `/repos/${owner}/${repo}/releases/tags/${tag}`,
method: 'GET',
headers: {
Expand All @@ -98,7 +99,7 @@ async function fetchReleaseInfoWithTagName(token, owner, repo, tag) {
return new Promise((resolve) => {
let reqGet = https.request(options, function (res) {
if (res.statusCode != 200) {
throw new Error(`response statusCode: ${res.statusCode}`)
console.error(`Error: response statusCode: ${res.statusCode}, please check if the tag (${tag}) exists in Github repo.`)
}
console.log(`response statusCode: ${res.statusCode}`)

Expand All @@ -116,6 +117,10 @@ async function fetchReleaseInfoWithTagName(token, owner, repo, tag) {
console.error(e);
throw new Error("Got error response.")
});
reqGet.on('timeout', function () {
reqGet.destroy()
throw new Error("Request timeout.")
});
reqGet.end();
})

Expand Down
3 changes: 3 additions & 0 deletions .github/scripts/release_notes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,15 @@ async function run() {
updateReleaseNotesPage("./src/pages/documentation/release-notes/index.md", sortedList)
const ignoreList = ['AEP React Native', 'Roku', 'AEP Flutter']
for (const releaseInfo of sortedList) {
// We don't have separate release note pages for AEP React Native, Roku, and AEP Flutter
if (ignoreList.includes(releaseInfo.platform)) {
continue
}
let filePath = releaseNoteMap[releaseInfo.extension]
if (filePath != undefined) {
updateReleaseNotesPage(filePath, [releaseInfo])
} else {
console.error(`Error: no release note page found for ${releaseInfo.extension}`)
}
}
let jsonObj = {
Expand Down
16 changes: 8 additions & 8 deletions .github/scripts/release_notes/releaseNoteMap.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
"Lifecycle": "./src/pages/documentation/mobile-core/release-notes.md",
"Identity": "./src/pages/documentation/mobile-core/release-notes.md",
"Signal": "./src/pages/documentation/mobile-core/release-notes.md",
"Assurance": "./src/pages/documentation/platform-assurance-sdk/release-notes.md",
"UserProfile": "./src/pages/documentation/profile/release-notes.md",
"Analytics": "./src/pages/documentation/adobe-analytics/release-notes.md",
"Campaign Standard": "./src/pages/documentation/adobe-campaign-standard/release-notes.md",
"Messaging": "./src/pages/documentation/adobe-journey-optimizer/release-notes.md",
"Target": "./src/pages/documentation/adobe-target/release-notes.md",
"EdgeConsent": "./src/pages/documentation/consent-for-edge-network/release-notes.md",
"Edge": "./src/pages/documentation/edge-network/release-notes.md",
"Places": "./src/pages/documentation/places/release-notes.md",
"Assurance": "./src/pages/documentation/platform-assurance-sdk/release-notes.md",
"Optimize": "./src/pages/documentation/adobe-journey-optimizer-decisioning/release-notes.md",
"Media": "./src/pages/documentation/adobe-media-analytics/release-notes.md",
"EdgeIdentity": "./src/pages/documentation/identity-for-edge-network/release-notes.md",
"EdgeMedia": "./src/pages/documentation/media-for-edge-network/release-notes.md",
"Messaging": "./src/pages/documentation/adobe-journey-optimizer/release-notes.md",
"Optimize": "./src/pages/documentation/adobe-journey-optimizer-decisioning/release-notes.md",
"Analytics": "./src/pages/documentation/adobe-analytics/release-notes.md",
"Target": "./src/pages/documentation/adobe-target/release-notes.md",
"Places": "./src/pages/documentation/places/release-notes.md",
"Media": "./src/pages/documentation/adobe-media-analytics/release-notes.md",
"Audience": "./src/pages/documentation/adobe-audience-manager/release-notes.md",
"Campaign Standard": "./src/pages/documentation/adobe-campaign-standard/release-notes.md",
"Campaign Classic": "./src/pages/documentation/adobe-campaign-classic/release-notes.md"
}
9 changes: 3 additions & 6 deletions .github/scripts/release_notes/update-release-notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,21 +179,18 @@ async function updateReleaseNotesPage(filePath, releaseInfoArray) {
// Read the contents of the markdown file.
let contentLines = fs.readFileSync(filePath, "utf8").toString().split("\n")
// Find the index of the release notes header.
let releaseNotesHeader = "# Release notes"
let releaseNotesHeader = "# Release Notes"
let releaseNotesHeaderIndex = contentLines.indexOf(releaseNotesHeader)
if (releaseNotesHeaderIndex == -1) {
releaseNotesHeaderIndex = contentLines.indexOf("# Release Notes")
}
if (releaseNotesHeaderIndex == -1) {
console.error("can't find the release notes header")
console.error("Error: can't find the release notes header")
return
}
let contentIsChanged = false
for (const releaseInfo of releaseInfoArray) {
let title = generateReleaseTitle(releaseInfo.platform, releaseInfo.extension, releaseInfo.version)
let titleLine = `### ${title}`
if (hasLineStartWith(titleLine, contentLines)) {
console.error("already updated")
console.error(`Already updated: ${titleLine}`)
continue
}
let dateStr = convertIOSDateToRleaseDateFormat(releaseInfo.published_at)
Expand Down
2 changes: 1 addition & 1 deletion src/pages/documentation/release-notes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Keywords:
- Release notes
---

# Release notes
# Release Notes

## September 26, 2023

Expand Down

0 comments on commit 9446966

Please sign in to comment.