Skip to content
This repository was archived by the owner on Apr 21, 2024. It is now read-only.

dylan publish removes values from package catalog #80

Closed
fraya opened this issue Feb 3, 2024 · 9 comments
Closed

dylan publish removes values from package catalog #80

fraya opened this issue Feb 3, 2024 · 9 comments

Comments

@fraya
Copy link
Member

fraya commented Feb 3, 2024

Publishing a new version of xml-parser I use the command dylan publish ../pacman-catalog.

In pacman-catalog the diff shows that "category" is empty where before there was the value "parsers" and contact is missing the email.

$ git diff v1/xm/l-/xml-parser
diff --git a/v1/xm/l-/xml-parser b/v1/xm/l-/xml-parser
index 21646e5..2a9b124 100644
--- a/v1/xm/l-/xml-parser
+++ b/v1/xm/l-/xml-parser
@@ -1,13 +1,21 @@
 {
-  "category": "parsers",
-  "contact": "dylan-lang@googlegroups.com",
+  "category": "",
+  "contact": "",
   "description": "XML parser",
   "keywords": [],
   "name": "xml-parser",
   "releases": [{
-                 "dependencies": ["meta@0.1"],
-                 "deps": ["meta@0.1"],
-                 "dev-dependencies": ["testworks@2.1"],
+                 "dependencies": ["meta@0.1.0"],
+                 "deps": ["meta@0.1.0"],
+                 "dev-dependencies": ["testworks@2.1.0"],
+                 "license": "MIT",
+                 "url": "https://github.com/dylan-lang/xml-parser",
+                 "version": "0.2.1"
+               },
+               {
+                 "dependencies": ["meta@0.1.0"],
+                 "deps": ["meta@0.1.0"],
+                 "dev-dependencies": ["testworks@2.1.0"],
                  "license": "MIT",
                  "url": "https://github.com/dylan-lang/xml-parser",
                  "version": "0.2.0"
@cgay
Copy link
Member

cgay commented Feb 4, 2024

I'll take a look at this if you're not already working on it.

@cgay
Copy link
Member

cgay commented Feb 5, 2024

I haven't been able to reproduce this when publishing a new release for dylan-tool, which also has "category" and "contact" entries. Still looking...

@fraya
Copy link
Member Author

fraya commented Feb 5, 2024

Just publish for 'http', this time only "contact" was removed, category was right.

@cgay
Copy link
Member

cgay commented Feb 5, 2024

ok, it happens when the dylan-package.json file doesn't contain the "category" or "contact" options, they don't get carried over to the new package definition because of the way it is built up from the dylan-package.json file instead of modifying the original package.

@cgay
Copy link
Member

cgay commented Feb 5, 2024

http/dylan-package.json only has "category", so that makes sense with what you described.

@cgay
Copy link
Member

cgay commented Feb 5, 2024

haha, it turns out this is working as intended! It's just been a while since I've worked on dylan-tool so I didn't understand it right away. The idea is that package-level attributes in dylan-package.json should override package-level attributes in the catalog. So if you change "category" or "contact" in dylan-package.json you're changing it in the catalog also.

Admittedly it's very unclear which attributes are package-level attributes. I'm not sure what to do about that.

@fraya
Copy link
Member Author

fraya commented Feb 6, 2024

I agree that package-level attributes in dylan-package.json should override package-level attributes in the catalog.

Like user, the only problem I see is: why are not the package-level attributes in the dylan-package.json in the repository of GH?

For instance, I don't see in the http dylan-package.json file the 'license' attribute, and releasing the v1.1.1 I have deleted the MIT license of v1.1.0 that now is "unknown".

@cgay
Copy link
Member

cgay commented Feb 6, 2024

I suspect there are some anomalies due to the way I originally created the package catalog, so I wouldn't be shocked if the catalog doesn't exactly match the dylan-package.json files.

Regarding "license", that's a release-level attribute since (my thinking was) that it might change over time. If I add "license": "MIT" to the http dylan-package.json and then publish a new version the license is correctly updated. If the license isn't specified it becomes "Unknown" due to this line: let license = optional-element("license", <string>, "Unknown");

Bottom line, I think it's working pretty much as intended although it could use some polish. For example the doc could be a lot clearer about which attributes belong to the package and which belong to specific releases.

@fraya
Copy link
Member Author

fraya commented Feb 6, 2024

Knowing that the discrepancy could come from the initial import, on my part, there is no problem if, when updating any of the packages, any field is empty, as I can fill it in manually. With no other reason, I close the issue.

@fraya fraya closed this as completed Feb 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants