Skip to content

Conversation

@patrickbrophy
Copy link
Contributor

This PR adds insert methods to classads and a method to insert items to an existing list attribute.

@patrickbrophy patrickbrophy added the enhancement New feature or request label Oct 31, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds comprehensive support for working with list attributes in ClassAds, including methods for creating, inserting, and appending list elements of various types.

  • Adds methods for inserting list attributes with typed convenience functions
  • Implements a method to incrementally build lists by appending elements
  • Provides comprehensive test coverage for all new list manipulation methods

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
classad/classad.go Adds InsertAttrList, InsertAttrListInt, InsertAttrListFloat, InsertAttrListString, InsertAttrListBool, InsertAttrListClassAd, and InsertListElement methods for working with list attributes
classad/classad_test.go Adds comprehensive test coverage for all new list manipulation methods, testing creation, appending, empty lists, and type-specific list functions

patrickbrophy and others added 2 commits October 31, 2025 14:16
Removed the inconsistent early return from InsertAttrListClassAd. It now follows the same pattern as the other InsertAttrList* methods, using make([]ast.Expr, len(values)) which correctly handles empty slices.

Co-authored-by: Copilot <[email protected]>
@bbockelm
Copy link
Collaborator

bbockelm commented Nov 2, 2025

Like the new generic-enabled version!

@bbockelm bbockelm merged commit 3d4b7c3 into PelicanPlatform:main Nov 2, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants