Skip to content

Conversation

@xzhang1
Copy link

@xzhang1 xzhang1 commented Aug 21, 2025

Fixes #1007

Requirements

All new code should be covered with tests, documentation should be updated. CI should pass.

Description of the Change

Some times when making the publish, "Label" and "Origin" are not set, or not set correctly thus need to be modified later. With this modification, "Label" and "Origin" can be modified through publish update, no need to drop the re-build the whole publish.

Checklist

  • unit-test added (if change is algorithm)
  • functional test added/updated (if change is functional)
  • documentation updated
  • author name in AUTHORS

@neolynx neolynx self-assigned this Aug 27, 2025
@neolynx neolynx requested a review from a team August 27, 2025 21:43
@neolynx neolynx added this to the 1.6.3 milestone Aug 27, 2025
Copy link
Member

@neolynx neolynx left a comment

Choose a reason for hiding this comment

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

excellent, thanks !

wonder if we should add some tests, making sure the values are respected...

@xzhang1 xzhang1 force-pushed the update_label branch 2 times, most recently from 49ef3d1 to 2d0d211 Compare September 2, 2025 07:01
@xzhang1
Copy link
Author

xzhang1 commented Sep 2, 2025

@neolynx Thanks for your kindly reminds. Updated the patch and make three test cases for it.

===
Support update "label" and "origin" of aptly publish on:

  1. Command aptly publish update
    Add new test case "t06_publish/PublishUpdate19Test"

  2. REST API: api.POST("/publish/:prefix/:distribution/update", apiPublishUpdate)
    Modify test case "t12_api/PublishUpdateSourcesAPITestRepo"

  3. REST API: api.PUT("/publish/:prefix/:distribution", apiPublishUpdateSwitch)
    Modify test case "t12_api/PublishSwitchAPITestRepo"

@xzhang1 xzhang1 requested a review from neolynx September 5, 2025 07:44
@xzhang1
Copy link
Author

xzhang1 commented Oct 27, 2025

@neolynx Is there anything else supplementary I need to do? Additionally, is there any possibility of adding this patch to Debian:trixie? One of our projects is built on Debian:trixie, and it would be beneficial to our project if this patch could be added to Debian:trixie.

@neolynx neolynx requested a review from a team January 4, 2026 12:59
@neolynx neolynx added the increase coverage The PR lacks test coverage label Jan 4, 2026
@neolynx
Copy link
Member

neolynx commented Jan 5, 2026

we need a system test to cover the changes in cmd/publish_update.go

maybe we can modify an existing one, or add a new one in system/t06_publish/update.py

@xzhang1
Copy link
Author

xzhang1 commented Jan 12, 2026

we need a system test to cover the changes in cmd/publish_update.go

maybe we can modify an existing one, or add a new one in system/t06_publish/update.py

I added a test case for it. See the file changes here https://github.com/aptly-dev/aptly/pull/1484/files:
Three file below are created for this new test case:
New added system/t06_publish/PublishUpdate19Test_gold
New added system/t06_publish/PublishUpdate19Test_release
Modified system/t06_publish/update.py

Line runCmd = "aptly publish update -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -label=fun -origin=earth maverick" update the publish and set label to "fun", set origin to "earth maverick".

I checked the newest source code and find the 19th test case is already exist. Compared with https://github.com/aptly-dev/aptly/pull/1522/files, file system/t06_publish/PublishUpdate19Test_gold and system/t06_publish/PublishUpdate19Test_release is not changed but just renamde from xxx19xxx to xxx20xxx. So we just need to rename that very test case( system/t06_publish/update.py), from "PublishUpdate19Test" to "PublishUpdate20Test" is OK.

@neolynx
Copy link
Member

neolynx commented Jan 14, 2026

I renamed on my branch already... but I think there is a problem in the test itself.. investigating...

@neolynx
Copy link
Member

neolynx commented Jan 14, 2026

rebased and renamed the tests...

@xzhang1
Copy link
Author

xzhang1 commented Jan 16, 2026

rebased and renamed the tests...

Sorry I missed the check function, with the renamed test case, this function is also need to be modified to align with it.
This line below also need to be modified from "19" to "20":
https://github.com/aptly-dev/aptly/pull/1484/files#diff-013e220c15c343df883f45597883bd063e699ce3c407b81473361160fbaab1cb

643 def check(self):
644 super(PublishUpdate19Test, self).check()

@neolynx
Copy link
Member

neolynx commented Jan 16, 2026

ok, I changed that :-)

the MRis still in your branch in your repo, you can commit to it as well ...

@codecov
Copy link

codecov bot commented Jan 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.61%. Comparing base (19b98c6) to head (0db9797).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1484      +/-   ##
==========================================
- Coverage   76.91%   76.61%   -0.30%     
==========================================
  Files         160      160              
  Lines       14707    14721      +14     
==========================================
- Hits        11312    11279      -33     
- Misses       2264     2315      +51     
+ Partials     1131     1127       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@neolynx neolynx removed the increase coverage The PR lacks test coverage label Jan 16, 2026
@neolynx
Copy link
Member

neolynx commented Jan 16, 2026

now it looks great ! :-)

could you add yourself to the AUTHORS file and click the check-mark in in MR description ?

then we are ready to merge !

Copy link
Member

@neolynx neolynx left a comment

Choose a reason for hiding this comment

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

thanks a lot !

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.

Add option to change settings of publish without dropping?

2 participants