Skip to content

fix: import primary artifacts before secondary artifacts - #562

Merged
yada merged 2 commits into
microcks:masterfrom
doraem-on:codex/fix-import-dir-primary-order
Oct 28, 2026
Merged

yada merged 2 commits into
microcks:masterfrom
doraem-on:codex/fix-import-dir-primary-order

Conversation

@doraem-on

Copy link
Copy Markdown
Contributor

Fixes #561.

import-dir currently uploads examples.yaml before openapi.yaml because it follows filesystem discovery order. On a first import, a secondary artifact can arrive before its API exists and be ignored. This change uploads detected primary artifacts first, preserving discovery order within each group.

Regression tests cover flat and recursive directories, stable ordering, primary-only and secondary-only imports, filtering, and upload-failure accounting. Four cases fail before the fix; all six pass after it. Tests use the real filesystem and a recording upload client; no live Microcks server was used.

Validation:

  • go test ./...
  • go test -race ./cmd -run 'TestImportDirectory' -count=1
  • go build ./...
  • go vet ./...
  • Repository policy guards and git diff --check

AI disclosure: ChatGPT was used to help implement the fix, write regression tests, and review and double-check the changes.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

👋 @doraem-on

Welcome to the Microcks community! 💖

Thanks and congrats 🎉 for opening your first pull request here! Be sure to follow the pull request template or please update it accordingly.

Hope you have a great time there!

Comment thread cmd/importDir.go Outdated
@doraem-on
doraem-on requested a review from Vaishnav88sk October 7, 2026 06:33
@Harsh4902
Harsh4902 dismissed Vaishnav88sk’s stale review October 9, 2026 15:53

Resolved previously

@Harsh4902 Harsh4902 added component/cli go Pull requests that update go code labels Oct 9, 2026
@Harsh4902 Harsh4902 added this to the Next milestone Oct 9, 2026

@Vaishnav88sk Vaishnav88sk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

GTG

@yada yada added the kind/bug Something isn't working label Oct 15, 2026
@yada

yada commented Oct 28, 2026

Copy link
Copy Markdown
Member

Verified the merge result (build, go vet, go test ./... pass). With examples.yaml (secondary) and openapi.yaml (primary) in a directory, import-dir uploads examples.yaml first on master and openapi.yaml first with this PR.

Disclosure: this comment was drafted with AI assistance, and the results were run locally.

@yada yada left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Verified locally. Disclosure: AI-assisted verification.

@yada
yada merged commit 1391439 into microcks:master Oct 28, 2026
4 checks passed
@github-actions

Copy link
Copy Markdown

🎉 @doraem-on

You are now a Microcks community contributor! 💖

Thanks and congrats 🚀 on merging your first pull request! We are delighted and very proud of you! 👏

📢 If you're using Microcks in your organization, please add your company name to this list. 🙏 It really helps the project to gain momentum and credibility. It's a small contribution back to the project with a big impact.

If you need to know why and how to add yourself to the list, please read the blog post "Join the Microcks Adopters list and Empower the vibrant open source Community 🙌"

Kudos and please keep going, we need you 🙌

This branch was successfully deployed

1 active deployment
Build — 058e3dcc Deployed Oct 9, 2026 by doraem-on via build-verify-package #779
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/cli go Pull requests that update go code kind/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

import-dir uploads secondary artifacts before their primary API definition

4 participants