Merge pull request 'feature/codeant-smoke-test' (#3) from feature/codeant-smoke-test into main

Reviewed-on: #3
This commit is contained in:
2026-03-29 22:04:23 +00:00
4 changed files with 40 additions and 13 deletions

View File

@@ -96,14 +96,39 @@ jobs:
if [ "${GITHUB_EVENT_NAME}" = "pull_request" ] && [ -n "${GITHUB_BASE_REF}" ]; then
echo "Running PR review against base branch: ${GITHUB_BASE_REF}"
for attempt in 1 2 3; do
echo "PR review attempt $attempt/3"
codeant review --base "${GITHUB_BASE_REF}" --exclude "${REVIEW_EXCLUDES}" 2>&1 | tee review.txt || true
if ! grep -q "Unexpected token '<'" review.txt; then
break
git fetch origin "${GITHUB_BASE_REF}" --depth=1 || true
CHANGED_FILES=$(git diff --name-only "origin/${GITHUB_BASE_REF}...HEAD" | grep '^.gitea/workflows/src/' | grep -v '^.gitea/workflows/codeant.yml' || true)
if [ -z "${CHANGED_FILES}" ]; then
echo "No source files changed in PR scope." | tee review.txt
exit 0
fi
echo "Files to review:"
echo "${CHANGED_FILES}"
FAILED=0
: > review.txt
while IFS= read -r file; do
[ -z "$file" ] && continue
echo "--- Reviewing: $file ---" | tee -a review.txt
codeant review --base "${GITHUB_BASE_REF}" --include "$file" --exclude "${REVIEW_EXCLUDES}" 2>&1 | tee -a review.txt || true
if grep -q "Unexpected token '<'\|HTTP error 403" review.txt; then
FAILED=1
echo "Transient API failure detected for $file; continuing to next file." | tee -a review.txt
fi
sleep $((attempt * 15))
done
# Pace requests to avoid backend throttling on CI runners.
sleep 12
done <<EOF
${CHANGED_FILES}
EOF
if [ "$FAILED" -eq 1 ]; then
echo "Completed with API instability; some files may be partially reviewed." | tee -a review.txt
fi
else
# For push to main: check if HEAD is a merge commit
PARENTS=$(git log -1 --format="%P" HEAD | wc -w)

View File

@@ -389,12 +389,10 @@ export function LearningFacilityNew() {
const [expandedTourCard, setExpandedTourCard] = useState<string | null>(null);
useEffect(() => {
console.log('LearningFacility component mounted'); // Debug log
window.scrollTo(0, 0);
// Listen for custom booking modal event from CTAPopupModal
const handleOpenBookingModal = () => {
console.log('Custom booking modal event received'); // Debug log
handleBookNow();
};
@@ -403,7 +401,6 @@ export function LearningFacilityNew() {
// Also check if we should auto-open the booking modal based on URL parameters
const urlParams = new URLSearchParams(window.location.search);
if (urlParams.get('autoBooking') === 'true') {
console.log('Auto-opening booking modal from URL parameter'); // Debug log
setTimeout(() => handleBookNow(), 100);
}
@@ -1850,7 +1847,6 @@ function BookingModal({
const handleFormSubmit = (e: React.FormEvent) => {
e.preventDefault();
console.log('Booking form submitted:', bookingForm);
// Here you would typically send the form data to your backend
alert('Booking request submitted successfully! We will contact you soon.');
onClose();

View File

@@ -2,7 +2,7 @@ export const getReadingTime = (text: string): string => {
if (!text) return "0 min read";
// Remove HTML tags if present
const cleanText = text.replace(/<[^>]+>/g, "");
const cleanText = text.replace(/<[^>]+>/g, "").replace(/&nbsp;/gi, " ");
if (!cleanText.trim()) return "0 min read";
// Count words

View File

@@ -18,8 +18,14 @@ export const createSlug = (text: string): string => {
* Example: "Ad ut neque enim omn", "e7d611b6-853b-4785-b508-599eeed2af92" -> "ad-ut-neque-enim-omn-e7d611b6-853b-4785-b508-599eeed2af92"
*/
export const getSlugWithId = (title: string, id: string) => {
const slug = createSlug(title);
const normalizedId = id.trim();
return `${createSlug(title)}-${normalizedId}`;
if (!slug && !normalizedId) return '';
if (!slug) return normalizedId;
if (!normalizedId) return slug;
return `${slug}-${normalizedId}`;
};
/**