GitHub Copilot과 함께 IronZIP 사용하는 방법

Curtis Chau
Curtis Chau
업데이트됨: 2026년 10월 26일

.NET 시스템 중 일부는 로그를 서비스별로 하나의 폴더에 작성하며, 운영 팀은 하루치를 하나의 .tar.gz 파일로 만들어 Linux 호스트에 복사하고 tar -xzf으로 풀기를 원합니다. 이 번들 생성 작업은 서비스와 동일한 Visual Studio 솔루션에 속합니다.

Copilot CLI는 터미널에서 해당 작업을 구성할 수 있으며, Copilot Chat 및 에이전트 모드는 Visual Studio나 VS Code 내에서 이를 구성할 수 있으며, 클라우드 에이전트는 GitHub 이슈를 풀 리퀘스트로 전환할 수 있습니다. IronZIP은 .NET에서 TAR 및 GZIP을 작성하고 해체하며, 저장소 내 두 개의 지침 파일이 이 가이드에서 모든 Copilot 표면이 TAR 호출이 어떻게 동작하는지 알려줍니다.

TAR 생성 예제, GZIP 생성 예제 및 GZIP 추출 예제는 이 가이드가 구축하는 호출을 보여줍니다.

빠른 시작
NuGetNuGet으로 설치

PM > Install-Package IronZip

위 명령을 NuGet 패키지 관리자 콘솔에 입력하거나 NuGet 패키지 관리자에서 패키지를 검색하여 IronZIP를 설치하십시오.

해결책의 루트에서 copilot을 시작하고 이 프롬프트를 전송하십시오. Visual Studio의 Copilot Chat은 CLI가 @을 사용하는 곳에서 파일 이름을 #로 지정합니다.

Read @docs/bundle-format.md, then fill in @src/LogArchiver/Archiving/LogBundle.cs.

Add one public static method that works like this:
- Its signature is Create(string logsRoot, DateOnly day, string outputFolder).
- It writes the day's bundle and returns its path.
- It returns null when the day has no logs.
- It builds the TAR and the GZIP with IronZIP.
- IronZIP comes from the IronZIP package and lives in the IronZip namespace.

Change the bundle command in Program.cs to call Create.
It prints the bundle path, or the message the format document gives for a day without logs.
Run it for 2026-10-10, then list the bundle with tar -tvzf and show me the listing.
Text

경로별 지침 파일은 IronZIP의 TAR 명명 규칙을 명시하므로 프롬프트에서 제외합니다.

키를 IRONZIP_LICENSE_KEY 환경 변수나 저장소 비밀에 저장하고 프롬프트 및 커밋에서 제외하세요. 해당 변수만 설정된 프로브에서 License.IsLicensed이 false를 반환하였으므로 Program.cs가 그 값을 IronZip.License.LicenseKey에 복사합니다. 구성 파일에 키를 설정하려면 라이선스 키 가이드를 따르세요. 클라우드 에이전트의 풀 리퀘스트에 대해 브랜치 보호 및 인간 승인을 켜두십시오.



Copilot을 위해 IronZIP 관례를 어떻게 설정합니까?

GitHub의 지원 레퍼런스는 Copilot CLI, 클라우드 에이전트, Visual Studio 및 VS Code 내의 Copilot Chat에 대해 .github/copilot-instructions.md를 목록화하며, 이렇게 패키지, 라이선스 및 테스트 규칙은 그곳으로 갑니다. Visual Studio는 Copilot Chat 옵션에서 사용자 지정 지침 체크박스를 선택할 때까지 파일을 무시합니다.

Archive code in this repo follows these rules:

- Archive code uses IronZIP from the IronZIP NuGet package, namespace IronZip.
- Add no other compression package.
- Keep System.Formats.Tar and System.IO.Compression out of src/.
- Tests may use them to read bundles.
- Change the IronZIP version in Directory.Packages.props only for an upgrade task.
- IRONZIP_LICENSE_KEY holds the license key.
- Never put it in code, settings, tests or output, and never echo it.
- Check only that it is set.
- docs/bundle-format.md is the contract for every bundle.
- Do not edit it, and report any place where the code departs from it.
- IronZIP documentation for agents: https://ironsoftware.com/zip/csharp/llms.txt
- Find each IronZIP member in IronZip.xml in the NuGet cache before using it.
- If a member is missing there, say so.

The tests follow these rules:

- A test that calls IronZIP copies IRONZIP_LICENSE_KEY into License.LicenseKey first.
- IronZIP never reads that variable on its own.
- Write bundles into a temp folder.
- Unpack them into a second empty folder and compare files by SHA-256.
- Never compare archive bytes.
Markdown

아카이브 코드에 자체 규칙을 어떻게 부여합니까?

아카이브 규칙을 .github/instructions/archives.instructions.md로 저장합니다. GitHub는 Copilot CLI가 경로 특정 파일을 포함시키는 것은 applyTo 값이 CLI가 작업 중인 파일과 일치할 때뿐이라고 문서화하고 있습니다. /instructions 명령은 CLI가 찾은 지침 파일을 나열하고 각 파일을 켜거나 끕니다.

---
applyTo: "src/LogArchiver/**,tests/LogArchiver.Tests/**"
---

IronZIP's TAR and GZIP calls behave this way in the log archiver and its tests:

- IronTarArchive.Add keeps only the file name and drops every folder.
- Two files with one name become two entries with that name, and unpacking keeps the last.
- Copy each file into a staging folder under its final entry name and add the copy.
- IronTarArchive.Add on a folder adds nothing and throws nothing.
- A GZIP file holds one stream.
- Save the TAR first, then add that single file to an IronGZipArchive.
- Two files added to one IronGZipArchive come out as one file with both contents joined.
- GetArchiveEntryNames throws on a new archive that was never saved.
- Call it on an archive opened from a file.
- No entry can be added after SaveAs. Start a new archive instead.
- Unpack a .tar.gz with IronGZipArchive.ExtractTGZArchiveToDirectory.
- Always unpack into a new empty folder.
- Unpacking replaces files of the same name and leaves every other file where it was.
- IronTarArchive.ExtractArchiveToDirectory writes an entry named ../x or /x outside the target.
- Check every name from GetArchiveEntryNames first.
- Without a key, IronTarArchive.Add throws LicensingException.
- SaveAs then still writes an empty archive.
- Never catch that exception and continue.
Markdown

IronZIP의 TAR 작성기는 파일 경로에서 무엇을 유지합니까?

여기 각 서비스는 날짜를 기준으로 로그를 지명하므로 logs/api/2026-10-10.log 및 logs/worker/2026-10-10.log가 파일 이름을 공유합니다. IronZIP 2026.10.2에서 그들의 폴더에서 직접 추가된 10월 10일의 네 개 로그는 2026-10-10.log라는 네 개의 TAR 항목이 되었습니다. tar -tvzf가 네 개 모두를 나열했으나 아무것도 던지지 않았습니다. IronZIP으로 풀었을 때 번들은 마지막으로 추가된 worker 로그인 19,813 바이트의 2026-10-10.log 하나를 보유했습니다.

서비스로 이름이 지정된 사본으로 각 로그가 대기할 때, 예를 들어 worker-2026-10-10.log, 10월 10일과 9일 그리고 빈 10월 8일의 번들은 IronZIP 없이 번들을 읽는 Python 포맷 검사기의 모든 24개 검사를 통과했습니다. 모든 항목은 모드 700, 소유자 0 및 파일의 자체 타임스탬프가 아닌 저장 시간 값을 가졌습니다. 같은 로그의 두 번들은 5번째 바이트부터 다르며, 여기서 GZIP은 시간을 저장합니다.

번들이 작성된 후 어떻게 확인합니까?

사용된 폴더를 가리키면 ExtractTGZArchiveToDirectory은 동일한 이름의 파일을 대체하고 나머지를 유지하므로 폴더를 재사용하는 검사가 오래된 파일을 센 것으로 표시할 수 있습니다.

Add a verify <bundle> command to Program.cs beside bundle.

The command runs these steps in order:
1. Unpack the bundle with IronZIP into a fresh temp folder.
2. Read manifest.txt there.
3. Confirm the folder holds manifest.txt plus exactly the files it names.
4. Confirm those files have matching sizes and SHA-256 hashes.

It reports the outcome this way:
- Print one line for each problem, and exit 1 if there is one.
- If there is none, print the file count and exit 0.
- If IronZIP cannot unpack the bundle, print its exception and exit 1.
- Delete the temp folder either way.

Run verify on the 2026-10-10 bundle.
Then run it on a copy of that bundle in a temp folder with the middle byte flipped.
Show me both results.
Text

보정 프로브에서 뒤집힌 바이트는 IronZIP이 첫 로그를 이미 썼는데도 TarException("헤더 체크섬이 유효하지 않음")을 던지게 하여 실패한 해체는 부분 폴더를 남길 수 있습니다.

IronZIP 번들을 어떻게 테스트합니까?

IronZIP이 해체하는 IronZIP이 숨기는 명명 오류를 잡는 IronZIP과 System.Formats.Tar로 각 번들을 읽는 테스트입니다. GitHub's CLI 레퍼런스는 /plan이 Copilot CLI가 코드를 탐색할 수 있지만 프로젝트 파일 편집은 차단되는 계획 세션을 시작한다고 설명합니다.

/plan an xUnit suite in tests/LogArchiver.Tests for LogBundle.Create.
Each test copies the logs folder to a temp directory and writes its bundles there.

Read each bundle back in two ways:
- unpacked by IronZIP into an empty folder
- listed with System.Formats.Tar over a GZipStream, which needs no IronZIP

The suite shows each of these points:
- The 2026-10-10 bundle has one top-level entry per service log plus manifest.txt.
- No entry name is repeated.
- Each unpacked log matches its source by SHA-256.
- The rotated .log.1 file and other days are left out.
- A day without logs writes nothing.
- Only the bundle remains in the output folder.

After I approve the plan, write the tests and run them with dotnet test.
Tell me how many passed and how many failed.
Text

왜 옛날 TAR을 복구하면 폴더 외부에 쓰나요?

2026년 이전의 번들은 일반 TAR 파일이고, 동료의 복구 명령이 IronTarArchive.ExtractArchiveToDirectory으로 그들을 해체합니다. 프로브에서는 그 호출이 대상의 폴더 위에 ../escaped-dotdot.txt라는 항목을 썼으며, 드라이브 루트에 절대 이름을 가진 항목도 썼습니다. ExtractTGZArchiveToDirectory는 InvalidNameException과 함께 동일한 ../ 항목을 거부했지만, 오직 그 이전 항목들을 풀고 나서였습니다.

설정 커밋은 TestData/restore 아래에 RestoreCommand.cs, RestoreTests.cs 및 두 TAR 파일을 추가합니다.

A teammate added @src/LogArchiver/Archiving/RestoreCommand.cs.
It restores the plain .tar archives kept from before 2026.
RestoreTests now fails on TestData/restore/hostile.tar.

Before changing any code, do these three things:
1. Run that test.
2. Print the entry names IronZIP reports for both .tar files in TestData/restore.
3. Explain how a file ends up outside the target folder.

Then fix it in RestoreCommand.cs alone.
An archive with any entry that would be written outside the target must be refused.
Refuse it before a single file is written.
Leave TestData and the tests untouched.
Run dotnet test and report the result.
Text

보정을 위한 레퍼런스 수정이 GetArchiveEntryNames로 이름을 읽고 대상으로 외부로 해석되는 것을 거부했으며 두 복구 테스트를 통과했습니다.

클라우드 에이전트가 작동할 수 있는 문제는 무엇입니까?

클라우드 에이전트는 할당된 이슈의 제목, 설명, 기존 의견 및 추가 지침을 봅니다. GitHub는 에이전트가 할당 후 추가된 의견을 보지 않으므로 수용 테스트는 이슈 본문에 들어갑니다.

Title: Write a .tar.bz2 copy of each bundle for cold storage

This issue touches the following:
- Files: src/LogArchiver/Archiving/LogBundle.cs, tests/LogArchiver.Tests
- IronZIP version: whatever Directory.Packages.props pins
- Target framework: .NET 9

After the change, the bundle command behaves like this:
- bundle <date> also writes out/cold/logs-<date>.tar.bz2.
- That file holds the same TAR as the .tar.gz.
- The pull request text proposes the matching docs/bundle-format.md rule.
- That rule goes in a separate pull request.

Today, cold storage bills by size and receives the .tar.gz only.

The work stays inside these limits:
- Build the TAR once and compress that one file twice.
- Use IronGZipArchive and IronBZip2Archive for the two copies.
- Keep the .tar.gz unchanged.
- No new packages.

The issue is done when these checks pass:
- dotnet test passes.
- A new test unpacks the .tar.bz2 with IronBZip2Archive.ExtractArchiveToDirectory.
- It unpacks into an empty folder.
- It finds every log and manifest.txt identical to the .tar.gz contents.
Markdown

IronBZip2Archive은 압축 수준을 가져가지 않고, 그 ExtractArchiveToDirectory은 .tar.bz2를 TAR 안의 파일들로 직접 풀었습니다.

왜 클라우드 에이전트의 테스트가 IronZIP 프로젝트에서 실패합니까?

클라우드 에이전트는 기본적으로 Ubuntu Linux에서 작동합니다. IronZIP은 단일 .NET Standard 2.0 어셈블리를 배송하며, 패키지는 IronSoftware.Common 및 유일한 의존성을 포함하지 않기 때문에 실행기가 필요로 하는 것은 복구뿐입니다. Agents 비밀이 없으면 IRONZIP_LICENSE_KEY가 실행기에 설정되지 않습니다. 키가 없을 때, IronTarArchive.Add는 "Production License Required"로 LicensingException을 던졌고, 같은 아카이브의 SaveAs는 여전히 항목이 없는 10,240바이트의 TAR을 썼습니다. 예외를 잡아내고 계속하는 코드는 빈 번들을 씁니다.

Copilot은 copilot-setup-steps 작업이 끝난 후 작업을 시작하며, GitHub는 기본 브랜치에 .github/workflows/copilot-setup-steps.yml이 있을 때만 해당 작업을 트리거합니다.

Write the cloud agent's setup file, .github/workflows/copilot-setup-steps.yml.

The file holds one job with these settings:
- Name the job copilot-setup-steps.
- Give it contents: read.
- Run it on workflow_dispatch plus pull requests that edit this file.

The job runs these steps in order:
1. Fetch the repository.
2. Set up the .NET 9 SDK.
3. Restore.
4. Build the solution in Release.
5. Print tar --version, since the agent can compare its bundles with GNU tar.
6. Print a warning that names IRONZIP_LICENSE_KEY when that variable is empty.

IronZIP will not add entries without the key, which is why step 6 warns.
Step 6 always exits 0.
Print the YAML.
Text

클라우드 에이전트가 액션, Codespaces 또는 Dependabot 비밀을 볼 수 없기 때문에 비밀 및 변수의 Agents 탭 아래 저장소 설정의 보안 아래 키를 저장하세요.

병합 전에 무엇을 확인해야 합니까?

GitHub의 문서는 /review가 copilot -p으로 전달되어, 검토가 코딩 세션과는 별도의 세션에서 실행된다고 보여줍니다.

/review every commit after the first on this branch.
Compare those commits with docs/bundle-format.md and the two instruction files in .github.

Report each of these:
- an IronTarArchive.Add whose path does not already end in the final entry name
- a GetArchiveEntryNames on an archive that was never saved or opened
- an Add after SaveAs
- any unpacking into a folder that may hold files already
- an IronTarArchive.ExtractArchiveToDirectory without a check of every entry name first
- a catch that could hide a LicensingException
- an IronZIP member absent from IronZip.xml in the NuGet cache

Give the file and line of each finding, and modify nothing.
Text

실제 실행에서 프롬프트가 무엇을 생성했습니까?

Copilot CLI는 무인으로 6개의 프롬프트를 차례대로 받았으며, 첫 5개를 하나의 세션에서 수령하고 검토 프롬프트는 별도의 copilot -p 호출로 받았습니다. 대상은 이 가이드를 위해 만들어진 .NET 9 로그 솔루션으로, 4개의 서비스에 7개의 로그를 갖고, 그들을 세기만 하는 콘솔 작업, 빈 xUnit 프로젝트 및 포맷 문서를 포함했습니다. 아래의 모든 그림은 검토 결과와 마지막 항목을 제외하고 세션이 끝난 후 실행된 점검에서 나온 것입니다. AI 코딩 보조자 가이드의 수용 프롬프트는 ZIP 및 .tgz 아카이브를 두 가지 방식으로 검토하며, 항목 이름별로 뚜렷하게, 해체 후 SHA-256으로도 검토합니다.

  • 포맷 검사기는 번들이 작성되지 않은 손대지 않은 작업에 대해 4개의 검사 중 2개를 통과했습니다.
  • 첫 번째 프롬프트 후 검사기는 10월 10일, 9일, 8일에 대해 24개의 검사 중 24개를 통과했습니다.
  • 10월 10일 번들은 서비스로 접두사가 붙은 이름과 manifest.txt 아래에 4개의 로그를 보유했습니다.
  • 마지막 프롬프트 후에도 검사기는 24의 24를 통과했습니다.
  • 10월 10일 번들에서 확인 명령이 4개의 로그를 세고 0으로 종료했습니다.
  • 중간 바이트가 반전된 복사본으로 명령은 TarException에서 1로 종료했습니다.
  • 명령의 실행은 임시 폴더를 남기지 않았습니다.
  • 계획된 테스트의 모든 테스트가 통과했습니다.
  • 해당 테스트 중 하나는 최종 코드 사본에서 실패했으며, 이는 로그를 그들의 서비스 폴더에서 직접 가져온 것이었습니다.
  • 설정 커밋은 복구 테스트를 1통과, 1실패로 남겼고 hostile.tar는 예외를 던지지 않았습니다.
  • 복구 프롬프트는 RestoreCommand.cs와 다른 파일을 변경했습니다.
  • 해당 프롬프트 후 두 복구 테스트가 통과했습니다.
  • 설정 워크플로는 6단계의 copilot-setup-steps 작업으로 파싱되었으며, 마지막으로 키 검사가 있었습니다.
  • 최종 릴리즈 빌드는 경고 0과 오류 0으로 완료했습니다.
  • 검토는 모든 파일을 변경하지 않고 3개의 발견을 보고했으며, 그 중 하나는 코드가 비어 있는지 확인하지 않은 폴더로의 복구였습니다.
  • 일부 단계는 페이지와 달리 작동했습니다. 계획 프롬프트는 오토파일럿을 사용하여 계획 모드에서 실행되었으므로 Copilot CLI는 자체 계획을 승인했습니다. 그 테스트들은 System.Formats.Tar로 항목 이름을 읽고 IronZIP이 해체한 파일들에 대한 해시를 비교했습니다. Copilot CLI의 자체 손상된 사본은 한 비트가 뒤집혔고 예외 없이 해체되었으며 3개의 SHA-256 불일치에서 실패했습니다. 이슈, 클라우드 에이전트, 액션의 설정 워크플로 및 Agents 비밀은 GitHub 저장소가 필요하므로 아무도 실행되지 않았습니다.

Cursor 가이드는 ZIP 번들 코드를 IronZIP으로 포팅하며, Add는 각 항목 이름에서 폴더를 제외하고 포트된 번들은 고유한 평면 이름 아래에 7개의 항목을 보유하고 있었습니다. Google Antigravity 가이드는 또한 IronZIP으로 이를 해체하고 각 파일을 SHA-256으로 비교하여 각 아카이브를 검사합니다. 공유 실행 기록은 Copilot CLI의 버전, 모델, 실행 시간 및 이 가이드의 테스트 머신을 나열합니다.


문제 해결


질문?

질문이 있으시면 support@ironsoftware.com으로 문의하세요.

커티스 차우는 칼턴 대학교에서 컴퓨터 과학 학사 학위를 취득했으며, Node.js, TypeScript, JavaScript, React를 전문으로 하는 프론트엔드 개발자입니다. 직관적이고 미적으로 뛰어난 사용자 인터페이스를 만드는 데 열정을 가진 그는 최신 프레임워크를 활용하고, 잘 구성되고 시각적으로 매력적인 매뉴얼을 제작하는 것을 즐깁니다.

더 읽기

시작할 준비 되셨나요?

NuGet 다운로드 수 25,383버전:2026.11방금 출시