Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to 5.24.0 #126

Merged
merged 7 commits into from
Aug 29, 2024
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
84 changes: 36 additions & 48 deletions .github/workflows/auto_bump_pr_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

- name: Define allowed and ignored files
run: |
ALLOWED_FILES="package.xml CMakeLists.txt CHANGELOG.rst setup.py"
ALLOWED_FILES="package.json package.xml CMakeLists.txt CHANGELOG.rst setup.py"
echo "ALLOWED_FILES=$ALLOWED_FILES" >> $GITHUB_ENV

IGNORED_FILES=".github .jenkins"
Expand Down Expand Up @@ -64,77 +64,66 @@ jobs:
fi
done

if [[ "$BASE_BRANCH" == "main" && "$HEAD_BRANCH" == "develop" && "$only_allowed_files" == true ]]; then
if [[ "$BASE_BRANCH" == "main" && ( "$HEAD_BRANCH" == "develop" || "$HEAD_BRANCH" == "tote" ) && "$only_allowed_files" == true ]]; then
echo "should_merge=true" >> $GITHUB_ENV
else
echo "should_merge=false" >> $GITHUB_ENV
fi
env:
GITHUB_TOKEN: ${{ secrets.SECRETS_GITHUB_TOKEN }}

- name: Wait and Check PR status
if: env.should_merge == 'true'
- name: Ready for review
if: success() && env.should_merge == 'true'
run: |
PR_NUMBER=$(jq -r '.pull_request.number' < $GITHUB_EVENT_PATH)
COMMIT_SHA=$(gh pr view $PR_NUMBER --json commits --jq '.commits[-1].oid')
PR_NUMBER=${{ github.event.pull_request.number }}
IS_DRAFT=$(gh pr view $PR_NUMBER --json isDraft --jq '.isDraft')

echo "pr_status_all_success=false" >> $GITHUB_ENV
for i in {1..30}; do
echo "Checking status checks... (Attempt $i)"
if [[ "$IS_DRAFT" == "true" ]]; then
gh pr ready $PR_NUMBER
echo "Draft status removed. Ready to merge."
fi
env:
GITHUB_TOKEN: ${{ secrets.SECRETS_GITHUB_TOKEN }}

STATUS_CHECKS=$(gh api graphql -f query='
query($owner: String!, $repo: String!, $commit: String!) {
repository(owner: $owner, name: $repo) {
object(expression: $commit) {
... on Commit {
status {
contexts {
context
state
}
}
}
}
}
}' -f owner="${{ github.repository_owner }}" -f repo="${{ github.event.repository.name }}" -f commit="$COMMIT_SHA" --jq '.data.repository.object.status.contexts')

SUCCESSFUL_CHECKS=0
TOTAL_CHECKS=0
for status in $(echo "$STATUS_CHECKS" | jq -r '.[] | @base64'); do
_jq() {
echo "${status}" | base64 --decode | jq -r ${1}
}

CONTEXT=$(_jq '.context')
STATE=$(_jq '.state')

if [[ "$CONTEXT" == "automerge" ]]; then
continue
fi
- name: Wait and Check PR status
if: success() && env.should_merge == 'true'
run: |
PR_NUMBER=$(jq -r '.pull_request.number' < "$GITHUB_EVENT_PATH")
STATUS_CHECKS=$(gh pr checks "$PR_NUMBER" --json name,state --jq '.[]')
echo "$STATUS_CHECKS" | jq -r '. | "\(.name): \(.state)"'

TOTAL_CHECKS=$((TOTAL_CHECKS + 1))
PR_STATUS_ALL_SUCCESS=true
echo "pr_status_all_success=true" >> $GITHUB_ENV

if [[ "$STATE" == "SUCCESS" ]]; then
SUCCESSFUL_CHECKS=$((SUCCESSFUL_CHECKS + 1))
for i in {1..10}; do
echo "Checking status checks... (Attempt $i)"
PR_NUMBER=$(jq -r '.pull_request.number' < "$GITHUB_EVENT_PATH")
STATUS_CHECKS=$(gh pr checks "$PR_NUMBER" --json name,state --jq '.[]')

while IFS= read -r status; do
CHECK_NAME=$(echo "$status" | jq -r '.name')
CHECK_STATE=$(echo "$status" | jq -r '.state')
if [[ "$CHECK_NAME" != "BUMP" && "$CHECK_STATE" != "SUCCESS" ]]; then
PR_STATUS_ALL_SUCCESS=false
break
fi
done
done <<< "$STATUS_CHECKS"

if [[ "$SUCCESSFUL_CHECKS" -eq "$TOTAL_CHECKS" && "$TOTAL_CHECKS" -gt 0 ]]; then
if [ "$PR_STATUS_ALL_SUCCESS" = true ]; then
echo "All required status checks are successful."
echo "pr_status_all_success=true" >> $GITHUB_ENV
break
fi
sleep 60
done
env:
GITHUB_TOKEN: ${{ secrets.SECRETS_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check all checkboxes
if: env.should_merge == 'true' && env.pr_status_all_success == 'true'
if: success() && env.should_merge == 'true' && env.pr_status_all_success == 'true'
run: |
gh pr view ${{ github.event.pull_request.number }} --json body --jq .body > pr_body.txt

PR_BODY=$(cat pr_body.txt)

CHECKED_BODY=$(echo "$PR_BODY" | sed 's/\[ \]/[x]/g')

if [[ "$PR_BODY" != "$CHECKED_BODY" ]]; then
Expand All @@ -154,4 +143,3 @@ jobs:
gh pr merge ${{ github.event.pull_request.number }} --merge --admin
env:
GITHUB_TOKEN: ${{ secrets.SECRETS_GITHUB_TOKEN }}

5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Changelog for package labelme
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

5.24.0 (2024-08-29)
-------------------
* Fixed a bug in setting rectangle and polygon which were set inversely
* Contributors: Dongyun Kim

5.23.0 (2024-08-08)
-------------------
* Added a version checker and enhanced the logging mode for labeling both polygons and bounding boxes
Expand Down
8 changes: 4 additions & 4 deletions labelme/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1191,9 +1191,9 @@ def toggleDrawMode(self, edit=True, createMode="polygon"):
self.actions.createRectangleMode.setEnabled(True)
else:
self.actions.createRectangleMode.setEnabled(
self._classType is None or 'segmentation' in self._classType)
self.actions.createMode.setEnabled(
self._classType is None or 'detection' in self._classType)
self.actions.createMode.setEnabled(
self._classType is None or 'segmentation' in self._classType)
self.actions.createCircleMode.setEnabled(False)
self.actions.createLineMode.setEnabled(False)
self.actions.createPointMode.setEnabled(False)
Expand All @@ -1203,15 +1203,15 @@ def toggleDrawMode(self, edit=True, createMode="polygon"):
self.actions.createMode.setEnabled(True)
self.actions.createRectangleMode.setEnabled(True)
else:
if createMode == "polygon":
if createMode == "rectangle":
self.actions.createMode.setEnabled(False)
self.actions.createRectangleMode.setEnabled(
self._classType is None or 'detection' in self._classType)
self.actions.createCircleMode.setEnabled(False)
self.actions.createLineMode.setEnabled(False)
self.actions.createPointMode.setEnabled(False)
self.actions.createLineStripMode.setEnabled(False)
elif createMode == "rectangle":
elif createMode == "polygon":
self.actions.createMode.setEnabled(
self._classType is None or 'segmentation' in self._classType
)
Expand Down
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>labelme</name>
<version>5.23.0</version>
<version>5.24.0</version>
<description>
Labeling tools.
</description>
Expand Down
2 changes: 1 addition & 1 deletion version.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<version>1.1.0</version>
<version>1.2.0</version>
<maintainer email="[email protected]">Pyo</maintainer>
<maintainer email="[email protected]">SungHyeon Oh</maintainer>
<license>GPLv3</license>
Expand Down
Loading