Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/postman/scripts/transform-for-api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ sed 's/\\"value\\": \\"<Circular reference to #[^>"]* detected>\\"//g' intermedi

echo "Updating name with version $current_api_revision"
jq --arg api_version "$current_api_revision" \
'.collection.info.name = ("MongoDB Atlas Administration API " + $api_version)' \
'.collection.info.name = ("MongoDB Atlas Administration API " + $api_version)' \
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
'.collection.info.name = ("MongoDB Atlas Administration API " + $api_version)' \
'.collection.info.name = ("[Latest] MongoDB Atlas Administration API " + $api_version)' \

I am wondering why we went for the ⭐ . Isn't clearer to use Latest instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The discussion started with using ⭐. I'm fine with changing it to [Latest]. Has there been a product decision on this? cc @matt-condon

Copy link
Member

@wtrocki wtrocki Feb 24, 2025

Choose a reason for hiding this comment

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

@yelizhenden-mdb Feel free to go ahead and use latest as star might not be universally recognizable across the globe as "first"/"latest".

Copy link
Collaborator

Choose a reason for hiding this comment

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

Rationale behind the ⭐ is there's a precedent for it and it probably stands out a bit more
I'm fine with [latest] but probably not [first]

Do we generally have a way that we denote the latest API version across docs for consistency?

Copy link
Member

Choose a reason for hiding this comment

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

Disscussed offline. ⭐ is the visual clue we want :)

intermediateCollectionNoCircular.json > intermediateCollectionWithName.json

echo "Adding Collection description to $DESCRIPTION_FILE"
Expand Down
20 changes: 19 additions & 1 deletion tools/postman/scripts/upload-collection.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ collection_transformed_path="${PWD}/${TMP_FOLDER}/${COLLECTION_TRANSFORMED_FILE_

pushd "${OPENAPI_FOLDER}"

current_collection_name="MongoDB Atlas Administration API ${current_api_revision}"
current_collection_name="MongoDB Atlas Administration API ${current_api_revision}"

echo "Fetching list of current collections"
echo "curl -o ${COLLECTIONS_LIST_FILE}
Expand All @@ -38,6 +38,24 @@ curl --show-error --fail --silent -o "${COLLECTIONS_LIST_FILE}" \
collection_exists=$(jq '.collections | any(.name=="'"${current_collection_name}"'")' "${COLLECTIONS_LIST_FILE}")

if [ "$collection_exists" = "false" ]; then
# Check if a collection with a star icon already exists
previous_star_collection_id=$(jq -r '.collections | map(select(.name | startswith("⭐")).id)[0] // empty' "${COLLECTIONS_LIST_FILE}")
if [[ -n "${previous_star_collection_id}" ]]; then
previous_collection_name=$(jq -r '.collections | map(select(.id=="'"${previous_star_collection_id}"'").name)[0]' "${COLLECTIONS_LIST_FILE}")
new_collection_name="${previous_collection_name//⭐/}"

echo "Removing star icon from the previous collection name"
echo "curl -o ${COLLECTIONS_LIST_FILE}
--location 'https://api.getpostman.com/collections/${previous_star_collection_id}'
--header 'X-API-Key: **********'
--data \"{\"collection\": {\"info\": {\"name\": \"${new_collection_name}\"}}}\""
curl --show-error --fail --silent --request PATCH \
--location "https://api.getpostman.com/collections/${previous_star_collection_id}" \
--header "Content-Type: application/json" \
--header "X-API-Key: ${POSTMAN_API_KEY}" \
--data "{\"collection\": {\"info\": {\"name\": \"${new_collection_name}\"}}}"
fi

# Create new collection
echo "Creating new remote collection ${current_collection_name}"
echo "curl -o ${COLLECTIONS_LIST_FILE}
Expand Down
Loading