Spaces:
Build error
Build error
Update app.py
Browse files24 unmodified lines2526272829303136 unmodified lines68697071727392 unmodified lines1661671681691701716 unmodified lines17817918018118218318424 unmodified lines# dictionary that collects tags that can be added to commit messages.# key -> column name in notion# value -> possible valuestag_dict = {"status_tag":["WIP", "ReviewNeeded", "Final"]}# tag part seperator -> #+ , other_tags36 unmodified linesbranch_data["commit_url"] = f"{server_url}streams/{stream_id}/commits/{latest_commit.id}"branch_data["commit_message"] = latest_commit.messagebranch_data["author"] = latest_commit.authorName#except Exception as e:# print(f"Error fetching commits for branch {branch.name}: {str(e)}")92 unmodified linesupdated_isoformat = updated_value.isoformat()else:updated_isoformat = datetime.datetime.now().isoformat() # Use datetime.datetime.now() herepage_data = {"properties": {6 unmodified lines"sub-variant": {"rich_text": [{"text": {"content": branch.get("sub-variant", "")}}]},"author": {"rich_text": [{"text": {"content": branch.get("author", "")}}]},"commit_message": {"rich_text": [{"text": {"content": branch.get("commit_message", "")}}]},"depends-on": {"multi_select": [{"name": d} for d in existing_depends_on]}}}24 unmodified lines2526272829303132333436 unmodified lines71727374757677787980818292 unmodified lines1751761771781791801811821836 unmodified lines19019119219319419519619724 unmodified lines# dictionary that collects tags that can be added to commit messages.# key -> column name in notion# value -> possible valuestag_dict = {"status-message":["WIP", "ReviewNeeded", "Final"]}# tag part seperator -> #+ , other_tags36 unmodified linesbranch_data["commit_url"] = f"{server_url}streams/{stream_id}/commits/{latest_commit.id}"branch_data["commit_message"] = latest_commit.messagebranch_data["author"] = latest_commit.authorName# Check if the commit message contains '#+' and then extract tagsif '#+' in latest_commit.message:tags_part = latest_commit.message.split("#+")[1]branch_data["status-message"] = [tg for tg in tag_dict["status-message"] if tg in tags_part]else:branch_data["status-message"] = []#except Exception as e:# print(f"Error fetching commits for branch {branch.name}: {str(e)}")92 unmodified linesupdated_isoformat = updated_value.isoformat()else:updated_isoformat = datetime.datetime.now().isoformat() # Use datetime.datetime.now() here# Prepare status-message tags for multi-selectstatus_messages = branch.get("status-message", [])status_message_data = [{"name": sm} for sm in status_messages]page_data = {"properties": {6 unmodified lines"sub-variant": {"rich_text": [{"text": {"content": branch.get("sub-variant", "")}}]},"author": {"rich_text": [{"text": {"content": branch.get("author", "")}}]},"commit_message": {"rich_text": [{"text": {"content": branch.get("commit_message", "")}}]},"depends-on": {"multi_select": [{"name": d} for d in existing_depends_on]},"status-message": {"multi_select": status_message_data}}}
app.py+15-2