IronZIP ile GitHub Copilot Nasıl Kullanılır

Curtis Chau
Curtis Chau
Güncellendi: 26 Ekim 2026

.NET sistemlerin bazıları günlükleri her servis için bir klasöre yazar ve operasyon ekibi bunların her bir gününü birer .tar.gz olarak kopyalayıp Linux ana bilgisayarına aktarıp tar -xzf ile açmak ister. Bu paketleri oluşturan iş, hizmetlerle aynı Visual Studio çözümüne aittir.

Copilot CLI, bu işi bir terminalde oluşturabilir, Copilot Chat ve ajan modu bunu Visual Studio veya VS Code içinde oluşturabilir ve bulut ajanı bununla ilgili bir GitHub sorununu bir çekme isteğine dönüştürebilir. IronZIP, .NET'ten TAR ve GZIP okur ve çıkarır ve depodaki iki talimat dosyası, bu kılavuzdaki her Copilot yüzeyine TAR çağrılarının nasıl davranacağını söyler.

TAR oluşturma örneği, GZIP oluşturma örneği ve GZIP çıkarma örneği bu kılavuzun dayandığı çağrıları gösterir.

Hızlı Başlangıç
NuGetNuGet ile Yükle

PM > Install-Package IronZip

Yukarıdaki komutu NuGet Paket Yöneticisi Konsolunda çalıştırarak veya NuGet Paket Yöneticisinde arama yaparak IronZIP'u yükleyin.

Çözüm kökünde copilot başlatın ve bu istemi gönderin. Visual Studio'daki Copilot Chat, CLI'nin @ kullanırken dosyaları # ile adlandırır.

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

Yol konulu talimat dosyası, IronZIP'in TAR adlandırma kuralını belirtir, bu nedenle istem onu dışlar.

Anahtarı IRONZIP_LICENSE_KEY ortam değişkeninde veya bir depo sırrında, istemlerin ve taahhütlerin dışında tutun. Yalnızca bu değişkenin ayarlandığı bir sonda, License.IsLicensed false döndürdü, bu nedenle Program.cs değeri IronZip.License.LicenseKey içine kopyalıyor. Bunun yerine bir yapılandırma dosyasında anahtarı ayarlamak için lisans anahtarı kılavuzunu izleyin. Bulut ajanının çekme istekleri için dal korumasını ve insan onayını açık tutun.



Copilot için IronZIP kurallarını nasıl belirlersiniz?

GitHub'un destek referansı, Copilot CLI için, bulut ajanı için ve hem Visual Studio hem de VS Code'daki Copilot Chat için .github/copilot-instructions.md'yi listeler, bu nedenle paket, lisans ve test kuralları oraya gider. Visual Studio, Copilot Chat seçeneklerindeki özel talimatlar onay kutusu seçilene kadar dosyayı görmezden gelir.

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

Arşiv koduna nasıl kendi kurallarını verirsiniz?

Arşiv kurallarını .github/instructions/archives.instructions.md olarak kaydedin. GitHub belgeleri, Copilot CLI'nin yol konulu bir dosyayı yalnızca applyTo değeri CLI'nin çalıştığı bir dosyayla eşleştiğinde eklediğini belirtir. /instructions komutu, CLI'nin bulduğu talimat dosyalarını listeler ve her birini açar veya kapatır.

---
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'in TAR oluşturucusu bir dosya yolundan ne saklar?

Buradaki her hizmet günlüğünü güne göre adlandırır, bu nedenle logs/api/2026-10-10.log ve logs/worker/2026-10-10.log bir dosya adı paylaşır. IronZIP 2026.10.2 ile klasörlerinden doğrudan eklenmiş, 10 Ekim için dört günlük, 2026-10-10.log olarak adlandırılan dört TAR girişi oldu. tar -tvzf dört günlüğün tamamını listeledi ve bir sıkıntı çıkmamıştı. IronZIP ile açılan paket, son eklenen işçi günlüğü olan 19.813 baytlık bir 2026-10-10.log içeriyordu.

Her günlük hizmeti için örneğin worker-2026-10-10.log olarak adlandırılmış bir kopya şeklinde aşamaya alındığından, Ekim 10 ve 9 için paketler ile boş Ekim 8, IronZIP olmadan paketleri okuyan bir Python format denetleyicisinin 24 kontrolünün tümünü geçti. Her giriş, 700 modu, sahip 0 ve dosyanın kendi zaman damgası yerine kaydedilme zamanına sahipti. Aynı günlüklerin iki saniye arayla oluşturulan iki paketi, GZIP'in zamanını sakladığı beşinci bayttan itibaren farklıydı.

Bir paket yazıldıktan sonra nasıl kontrol edersiniz?

Kullanılmış bir klasöre işaret eden ExtractTGZArchiveToDirectory aynı adı taşıyan dosyaları değiştirir ve diğerlerini saklar, böylece bir klasörü yeniden kullanan bir kontrol, bayat bir dosya sayabilir.

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

Kalibrasyon probunda, çevrilen bayt IronZIP'i ilk günlüğü zaten yazdıktan sonra TarException'ı ('Başlık denetim toplamı geçersiz') attı, bu nedenle başarısız bir açma işlemi kısmi bir klasör bırakabilir.

Bir IronZIP paketini nasıl test edersiniz?

Her paketi System.Formats.Tar ile ve IronZIP ile okuyan bir test, IronZIP'in bir açma işlemini gizlediği adlandırma hatasını yakalar. GitHub'un CLI referansı /plan'nın Copilot CLI'nin kodu keşfetmesine izin verdiği, ancak proje dosyalarını düzenlemesinin engellendiği bir planlama oturumunu başlattığını belirtir.

/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

Neden eski bir TAR kendi klasörü dışına yazılır?

2026'dan önceki paketler düz TAR dosyalarıdır ve bir takım arkadaşının geri yükleme komutu onları IronTarArchive.ExtractArchiveToDirectory ile açar. Bir sonda, bu çağrı hedefin üzerindeki klasöre ../escaped-dotdot.txt adlı bir giriş yazdı ve sürücünün köküne mutlak bir ad ile bir tanesini yazdı. ExtractTGZArchiveToDirectory aynı ../ girişini InvalidNameException ile reddetti, ancak yalnızca öncesindeki girişleri açtıktan sonra.

Bir kurulum taahhüdü RestoreCommand.cs, RestoreTests.cs ve TestData/restore altında iki TAR dosyası ekler.

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

Kalibrasyon için yazılan bir referans düzeltmesi GetArchiveEntryNames ile adları okudu, hedefin dışına çözümlenenleri reddetti ve her iki geri yükleme testini geçti.

Bulut ajanının etkili olduğu bir sorun ne yapar?

Bulut ajanı, atanmış bir sorunun başlığını, açıklamasını, mevcut yorumları ve ek talimatları görür. GitHub, ajan atamadan sonra eklenen yorumları görmediğini, bu nedenle kabul testinin sorun gövdesine koyulması gerektiğini belirtir.

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 herhangi bir sıkıştırma seviyesi almaz ve ExtractArchiveToDirectory bir .tar.bz2'yi doğrudan TAR içindeki dosyalara açtı.

Bulut ajanının testleri neden bir IronZIP projesinde başarısız olur?

Bulut ajanı varsayılan olarak Ubuntu Linux'ta çalışır. IronZIP, tek bir .NET Standard 2.0 derlemesi gönderir ve ne paketi ne de bağımlılığı olan IronSoftware.Common, yerel bir ikili içermez, bu nedenle bir geri yükleme koşucunun ihtiyacı olan tek şeydir. Bir Agents sırrı olmadan, IRONZIP_LICENSE_KEY koşucuda ayarlanmaz. Anahtar olmadan, IronTarArchive.Add 'Production License Required' ile LicensingException verdi ve aynı arşivdeki SaveAs giriş olmadan 10.240 baytlık bir TAR yazdı. İstisnayı yakalayan ve devam eden kod boş paketler yazar.

Copilot, copilot-setup-steps iş bitene kadar çalışmaya başlamaz ve GitHub, varsayılan dalda .github/workflows/copilot-setup-steps.yml olduğunda yalnızca o görevi tetikler.

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

Anahtarı Gizli ve değişkenler sekmesinde, depodaki Güvenlik ayarında Agents sekmesinde kaydedin, çünkü bulut ajanı Actions, Codespaces veya Dependabot sırlarını göremez.

Birleştirmeden önce neyi kontrol etmelisiniz?

GitHub'un belgeleri /review'nin copilot -p'ye aktarıldığını gösterir, bu nedenle inceleme kendi oturumunda, kodlama oturumundan bağımsız olarak çalıştırılır.

/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

Gerçek bir çalıştırmada istemler ne üretti?

Copilot CLI, altı istemi sırasıyla ve izinsiz olarak aldı, ilk beşini bir oturumda ve inceleme istemini ayrı bir copilot -p çağrısında aldı. Hedef, bu kılavuz için yapılmış bir .NET 9 günlük çözümüydü, dört hizmet boyunca yedi günlük, yalnızca onları sayan bir konsol işi, boş bir xUnit projesi ve format belgesi içeriyordu. Aşağıdaki tüm şekiller inceleme bulguları ve son madde dışındaki oturum sonlandıktan sonra yürütülen kontrollerden gelir. AI kodlama asistanları kılavuzundaki kabul istemi ZIP ve .tgz arşivlerini iki şekilde, farklı giriş adları ve çıkarıldıktan sonra SHA-256 ile aynı şekilde kontrol eder.

  • Format denetleyicisi temas edilmemiş işteki 4 kontrolden 2'sini geçti, ki bu hiç paket yazmadı.
  • İlk istemden sonra, Ekim 10, 9 ve 8 için denetleyici 24 kontrolün tümünü geçti.
  • Ekim 10 paketi beş giriş içeriyordu, hizmet ekli adlar altında dört günlük ve manifest.txt.
  • Denetleyici, son istemden sonra 24'te 24 geçti.
  • Ekim 10 paketinde, doğrulama komutu 4 günlüğü saydı ve 0 ile çıktı.
  • Orta baytı çevrilmiş bir kopya, komutun TarException'da 1 ile çıkmasına neden oldu.
  • Komutun her iki çalışması da bir geçici klasör bırakmadı.
  • Planlanan paketin her iki testi de geçti.
  • Bu testlerden biri, günlükleri doğrudan hizmet klasörlerinden ekleyen son kodun bir kopyasında başarısız oldu.
  • Ayarlama taahhüdü, geri yükleme testlerini 1 geçti, 1 başarısız olarak bıraktı ve hostile.tar herhangi bir istisna atmadı.
  • Geri yükleme istemi RestoreCommand.cs dosyasını değiştirdi, başka hiçbir dosyayı değiştirmedi.
  • O istemden sonra her iki geri yükleme testi de geçti.
  • Ayarlama iş akışı, anahtar kontrolü son adımda olmak üzere 6 adımlı bir copilot-setup-steps işi olarak ayrıştırıldı.
  • Son Sürüm yapısı 0 uyarı ve 0 hata ile tamamlandı.
  • İnceleme her dosyayı değişmeden bıraktı ve üç bulgu raporladı, bunlardan biri kodun asla boş olup olmadığını kontrol etmediği bir klasöre geri yükeleme idi.
  • Bazı adımlar sayfadan farklı çalıştı. Plan isteği, plan modunda otomatik pilotla çalıştı, bu nedenle Copilot CLI kendi planını onayladı. Testler, System.Formats.Tar ile giriş adlarını okudu ve IronZIP'in açtığı dosyalar üzerinde hash'leri karşılaştırdı. Copilot CLI'nin kendi bozuk kopyasında bir bit çevrilmişti, istisnasız çıkarılmıştı ve üç SHA-256 uyuşmazlığında başarısız oldu. Sorun, bulut ajanı, Actions üzerindeki ayarlama iş akışı ve Agents sırrı bir GitHub deposuna ihtiyaç duyuyor, bu yüzden hiçbiri çalıştırılmadı.

Cursor kılavuzu ZIP paket kodunu IronZIP'e taşır ve burada Add, ayrıca her giriş adından klasörü kaldırır ve taşınmış paketi benzersiz düz bir ad altında her biri olmak üzere 7 giriş içerir. Google Antigravity kılavuzu ayrıca IronZIP ile arşivi çıkararak ve her dosyayı SHA-256 ile karşılaştırarak her arşivi kontrol eder. paylaşılan çalışma kaydı, bu kılavuz için Copilot CLI'nin sürümünü, modeli, çalışma süresini ve test makinesini listeler.


Hata Ayıklama


Sorular?

Herhangi bir sorunuz varsa, support@ironsoftware.com adresinden bize ulaşın

Curtis Chau, Bilgisayar Bilimleri alanında Lisans Derecesine (Carleton Üniversitesi) sahip ve Node.js, TypeScript, JavaScript ve React konularında uzmanlaşmış ön uç geliştirmeyle ilgileniyor. Sezgisel ve estetik açıdan hoş kullanıcı arayüzleri oluşturma tutkunu, Curtis modern çerçevelerle çalışmayı ve iyi yapılandırılmış, görsel olarak çekici kılavuzlar oluşturmayı seviyor.

Daha Fazla Oku

Başlamaya Hazır mısınız?

NuGet İndirmeleri 25,383Sürüm:2026.11yeni çıktı