Skip to content
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

ci: create placeholder file for new commands before validation #16771

Merged
merged 1 commit into from
Feb 24, 2023

Conversation

crazy-max
Copy link
Member

@crazy-max crazy-max commented Feb 24, 2023

Proposed changes

Our validate-upstream workflow does not take into account new commands that don't have (yet) a placeholder markdown file and therefore fails with https://github.com/docker/buildx/actions/runs/4262324143/jobs/7417733008#step:8:3742

#0 0.048 - ./_site/engine/reference/commandline/buildx/index.html
#0 0.048   *  internally linking to /engine/reference/commandline/buildx_debug-shell/, which does not exist (line 206)
#0 0.048      <a href="/engine/reference/commandline/buildx_debug-shell/">docker buildx debug-shell</a>

This change ensures a placeholder exists and creates it if it's not there.

Tested here: https://github.com/docker/buildx/actions/runs/4263151955/jobs/7419575907#step:7:38

Related issues (optional)

@crazy-max crazy-max requested review from jedevc and dvdksn February 24, 2023 14:10
@netlify
Copy link

netlify bot commented Feb 24, 2023

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit f5ea254
🔍 Latest deploy log https://app.netlify.com/sites/docsdocker/deploys/63f8c8e10f867b000882728c
😎 Deploy Preview https://deploy-preview-16771--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

const yamlDestPath = path.join('_data', `${{ inputs.data-files-folder }}`, yamlSrcFilename);
const placeholderPath = path.join(dataFilesPlaceholderFolder, yamlSrcFilename.replace(/^docker_/, '').replace(/\.yaml$/, '.md'));
if (dataFilesPlaceholderFolder !== '' && !fs.existsSync(placeholderPath)) {
const placeholderContent = `---\ndatafolder: ${{ inputs.data-files-folder }}\ndatafile: ${yamlSrcFilename.replace(/\.[^/.]+$/, '')}\ntitle: ${yamlSrcFilename.replace(/\.[^/.]+$/, "").replaceAll('_', ' ')}\n---\n{% include cli.md datafolder=page.datafolder datafile=page.datafile %}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we split this up into multiple lines? Creating an array first, then joining with newlines?

It's a bit tricky to read at the moment.

Copy link
Member Author

Choose a reason for hiding this comment

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

Could we split this up into multiple lines?

👍


Didn't want to waste time with templating or handlebars for this stuff but we can look at this in follow-up to clean this up a bit.

.github/workflows/validate-upstream.yml Show resolved Hide resolved
@crazy-max crazy-max force-pushed the fix-ci-validate-upstream branch from 40a2b9d to f5ea254 Compare February 24, 2023 14:25
@crazy-max crazy-max merged commit c116a6d into docker:main Feb 24, 2023
@crazy-max crazy-max deleted the fix-ci-validate-upstream branch February 24, 2023 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants