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

Fetch Swift Package Dependencies from internal azure repos #4855

Open
1 of 4 tasks
jinaiyuanbaojie opened this issue Jun 19, 2024 · 5 comments
Open
1 of 4 tasks

Fetch Swift Package Dependencies from internal azure repos #4855

jinaiyuanbaojie opened this issue Jun 19, 2024 · 5 comments

Comments

@jinaiyuanbaojie
Copy link

jinaiyuanbaojie commented Jun 19, 2024

Describe your question

Hi team. I am a iOS developer and I am using AzureDevOps in my daily work.
I have a iOS repo and it manages its dependencies via Apple official SwiftPackage which I can config the dependency as a git repo.
Now I also have some internal dependency libraries on azure repos. And they are referenced by my iOS repo.
Then my question is how can I fetch the internal dependencies on our azure pipeline local agent?
Are there any solutions or options?
TIPS:
All of our azure repos can not be public by our policy.
And we are enable 2FA(SoftToken PIN) on our azure devops

Versions

Agent version 3.225.3 | MacOS 13.6.6

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Operation system

MacOS Ventura 13.6.6

Version controll system

git

Azure DevOps Server Version (if applicable)

No response

@ismayilov-ismayil
Copy link
Contributor

Hi @jinaiyuanbaojie
as I understood you want to retrieve internal ios packages into self-hosted agent, right? if yes, you have several options to do it.

  1. If you dependency is something git repository you can add another checkout steps in the pipeline to pull that package repository into your source folder, then use it.
  2. if it is something in the artifact feed (package repository) then you can create service connection and use it in the pipeline

@jinaiyuanbaojie
Copy link
Author

Hi @jinaiyuanbaojie
as I understood you want to retrieve internal ios packages into self-hosted agent, right? if yes, you have several options to do it.

  1. If you dependency is something git repository you can add another checkout steps in the pipeline to pull that package repository into your source folder, then use it.
  2. if it is something in the artifact feed (package repository) then you can create service connection and use it in the pipeline

Yeah man. You are right. But the fetching progress is controlled by iOS Swift Package Manage itself. We can only config the git repo address and branch or tag to be referenced in Package.Swift.
So I can not use checkout directly

@ismayilov-ismayil
Copy link
Contributor

In this case you can add corresponding permission in the repository branch security section. Then use git reference with $(System.AccessToken) to make it available in your self-hosted agent

@jinaiyuanbaojie
Copy link
Author

Hi team, Let us say our team has a repo and it looks like

├── Sources
├── Dummy.xcworkspace
├── README.MD
├── Dependencies
  ├── Package.resolved
  ├── **Package.swift**

And the Package.swift looks like

import PackageDescription

let package = Package(
    name: "MyDependencies",
    platforms: [
        .iOS(.v14),
    ],
    dependencies: [
        **.package(url: "https://azure.internal.com/dummy/thirdparty", from: "1.10.3"),**
    ]
)

We iOS developers config the third-party and internal dependencies into this Package.swift file.
For this dummy case, it is https://azure.internal.com/dummy/thirdparty which is our internal azure repo also.
The key point is that the progress of git fetch pull or clone is controlled by Apple Official Swift Package it self (swift package resolve).
We can not add checkout: xxx at pipeline to address this case.

Is it clear enough for you guys? Any idea?

Thanks in advance. :)

@jinaiyuanbaojie
Copy link
Author

Hi team. Could you give me some suggestion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants