Skip to content

Commit 8eeddbd

Browse files
authored
chore: migrate google-cloud-workflows (googleapis#8794)
* chore: update library config * generate google-cloud-workflows * add additional protos * restore * add proto path * update library * add librarian.js * regenerate * update librarian.js * regenerate * update librarian.js * regenerate * update librarian.js * regenerate * update proto path * regenerate * update librarian.js * update librarian.js * regenerate
1 parent 2a3a77c commit 8eeddbd

11 files changed

Lines changed: 2655 additions & 1711 deletions

File tree

librarian.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1769,7 +1769,6 @@ libraries:
17691769
- path: google/cloud/workflows/executions/v1
17701770
- path: google/cloud/workflows/executions/v1beta
17711771
copyright_year: "2026"
1772-
skip_generate: true
17731772
nodejs:
17741773
default_version: v1
17751774
- name: google-cloud-workloadmanager

packages/google-cloud-workflows/.OwlBot.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

packages/google-cloud-workflows/.prettierrc

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
{
2-
"name": "workflowexecutions",
3-
"name_pretty": "Workflow Executions",
4-
"product_documentation": "https://cloud.google.com/workflows/docs/",
5-
"client_documentation": "https://cloud.google.com/nodejs/docs/reference/workflows/latest",
6-
"issue_tracker": "https://github.com/googleapis/google-cloud-node/issues",
7-
"release_level": "stable",
8-
"language": "nodejs",
9-
"repo": "googleapis/google-cloud-node",
10-
"distribution_name": "@google-cloud/workflows",
11-
"api_id": "workflowexecutions.googleapis.com",
12-
"requires_billing": true,
13-
"default_version": "v1",
14-
"api_shortname": "workflowexecutions",
15-
"library_type": "GAPIC_AUTO",
16-
"codeowner_team": "@googleapis/aap-dpes"
17-
}
2+
"api_description": "Manage workflow definitions. To execute workflows and manage executions,\nsee the Workflows Executions API.",
3+
"api_id": "workflows.googleapis.com",
4+
"api_shortname": "workflows",
5+
"client_documentation": "https://cloud.google.com/nodejs/docs/reference/workflows/latest",
6+
"default_version": "v1",
7+
"distribution_name": "@google-cloud/workflows",
8+
"issue_tracker": "https://issuetracker.google.com/savedsearches/559729",
9+
"language": "nodejs",
10+
"library_type": "GAPIC_AUTO",
11+
"name": "workflows",
12+
"name_pretty": "Workflows",
13+
"product_documentation": "https://cloud.google.com/workflows/docs",
14+
"release_level": "stable",
15+
"repo": "googleapis/google-cloud-node"
16+
}

packages/google-cloud-workflows/codecov.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/google-cloud-workflows/librarian.js

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -15,55 +15,6 @@
1515
const fs = require('fs');
1616
const path = require('path');
1717

18-
/**
19-
* Replaces all occurrences of a pattern in a file with a specified replacement string.
20-
* @param {string} filePath The path to the file.
21-
* @param {RegExp} pattern The regular expression to search for.
22-
* @param {string} replacement The string to replace the pattern with.
23-
*/
24-
function replaceInFile(filePath, pattern, replacement) {
25-
try {
26-
const data = fs.readFileSync(filePath, 'utf8');
27-
const result = data.replace(pattern, replacement);
28-
fs.writeFileSync(filePath, result, 'utf8');
29-
console.log(`Successfully updated: ${filePath}`);
30-
} catch (err) {
31-
console.error(`Error processing file ${filePath}:`, err);
32-
}
33-
}
34-
35-
/**
36-
* Recursively finds files that match a specific pattern without using glob.
37-
* @param {string} baseDir The base directory to start the search from.
38-
* @param {string} filePattern A regular expression pattern to match against file paths.
39-
* @returns {string[]} An array of file paths that match the pattern.
40-
*/
41-
function findFiles(baseDir, filePattern) {
42-
const matches = [];
43-
const patternRegex = new RegExp(filePattern.replace(/\*/g, '[^/]*'), 'i');
44-
45-
function traverse(dir) {
46-
try {
47-
const entries = fs.readdirSync(dir, { withFileTypes: true });
48-
for (const entry of entries) {
49-
const fullPath = path.join(dir, entry.name);
50-
if (entry.isDirectory()) {
51-
traverse(fullPath);
52-
} else if (patternRegex.test(fullPath)) {
53-
matches.push(fullPath);
54-
}
55-
}
56-
} catch (err) {
57-
if (err.code !== 'ENOENT') {
58-
console.error(`Error reading directory ${dir}:`, err);
59-
}
60-
}
61-
}
62-
63-
traverse(baseDir);
64-
return matches;
65-
}
66-
6718
const filesToDelete = [
6819
'src/v1/workflows_client.ts',
6920
'src/v1/workflows_client_config.json',
@@ -88,34 +39,3 @@ filesToDelete.forEach(file => {
8839
}
8940
}
9041
});
91-
92-
const replacements = [
93-
{
94-
files: 'packages/google-cloud-workflows/src/index.ts',
95-
searchPattern: /import \* as v1 from '\.\/v1';/s,
96-
replacement: ''
97-
},
98-
{
99-
files: 'packages/google-cloud-workflows/src/index.ts',
100-
searchPattern: /import \* as v1beta from '\.\/v1beta';/s,
101-
replacement: ''
102-
},
103-
{
104-
files: 'packages/google-cloud-workflows/src/index.ts',
105-
searchPattern: /export {v1, v1beta, v1, v1beta, ExecutionsClient};/s,
106-
replacement: 'export {v1, v1beta, ExecutionsClient};'
107-
},
108-
{
109-
files: 'packages/google-cloud-workflows/src/index.ts',
110-
searchPattern: /export default {v1, v1beta, v1, v1beta, ExecutionsClient};/s,
111-
replacement: 'export default {v1, v1beta, ExecutionsClient};'
112-
},
113-
];
114-
115-
replacements.forEach(r => {
116-
const relativePattern = r.files.replace(/^packages\/google-cloud-workflows\//, '');
117-
const files = findFiles(__dirname, relativePattern);
118-
files.forEach(file => {
119-
replaceInFile(path.resolve(file), r.searchPattern, r.replacement);
120-
});
121-
});

0 commit comments

Comments
 (0)