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
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Bug report
about: Create a report to help us improve

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
58 changes: 58 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# NOT READY FOR REVIEW
- (Edit the above to reflect status)

# Summary
- TL;DR - what's this PR for?

# Review By (Date)
- When does this need to be reviewed by?

# Criticality
- How critical is this PR on a 1-10 scale? Also see [Severity Assessment](https://stanfordits.atlassian.net/browse/D8CORE-1705).
- E.g., it affects one site, or every site and product?

# Review Tasks

## Setup tasks and/or behavior to test

1. Check out this branch
2. Navigate to...
3. Verify...

## Front End Validation
- [ ] Is the markup using the appropriate semantic tags and passes HTML validation?
- [ ] Cross-browser testing has been performed?
- [ ] Automated accessibility scans performed?
- [ ] Manual accessibility tests performed?
- [ ] Design is approved by @ user?

## Backend / Functional Validation
### Code
- [ ] Are the naming conventions following our standards?
- [ ] Does the code have sufficient inline comments?
- [ ] Is there anything in this code that would be hidden or hard to discover through the UI?
- [ ] Are there any [code smells](https://blog.codinghorror.com/code-smells/)?
- [ ] Are tests provided? eg (unit, behat, or codeception)

### Code security
- [ ] Are all [forms properly sanitized](https://www.drupal.org/docs/8/security/drupal-8-sanitizing-output)?
- [ ] Any obvious [security flaws or new areas for attack](https://www.drupal.org/docs/8/security)?

## General
- [ ] Is there anything included in this PR that is not related to the problem it is trying to solve?
- [ ] Is the approach to the problem appropriate?

# Affected Projects or Products
- Does this PR impact any particular projects, products, or modules?

# Associated Issues and/or People
- JIRA ticket(s)
- Other PRs
- Any other contextual information that might be helpful (e.g., description of a bug that this PR fixes, new functionality that it adds, etc.)
- Anyone who should be notified? (`@mention` them here)

# Resources
- [SiteImprove](https://siteimprove.stanford.edu)
- [Accessibility Manual Test Script](https://docs.google.com/document/d/1ZXJ9RIUNXsS674ow9j3qJ2g1OAkCjmqMXl0Gs8XHEPQ/edit?usp=sharing)
- [HTML Validator](https://validator.w3.org/)
- [Browserstack](https://live.browserstack.com/dashboard)
18 changes: 18 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# .github/workflows/release.yml
name: Release

on:
pull_request:
types: closed

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Tag
uses: K-Phoen/semver-release-action@master
with:
release_branch: master
tag_format: "%major%.%minor%.%patch%"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# churro
# CHURRO
Cloud Hosting Usage Reporting with Recurring Output

## Usage
1. Add your Acquia API key and secret to a file called `.env.local` at the root of the repository directory:
1. Add your Acquia API key, API secret, subscription UUID, and your Views/Visits entitlements to a file called `.env.local` at the root of the repository directory:
```
ACQUIA_API_KEY=<key here>
ACQUIA_API_SECRET=<secret here>
NEXT_PUBLIC_ACQUIA_SUBSCRIPTION_UUID=<UUID here>
NEXT_PUBLIC_ACQUIA_MONTHLY_VIEWS_ENTITLEMENT=<integer here>
NEXT_PUBLIC_ACQUIA_MONTHLY_VISITS_ENTITLEMENT=<integer here>

```
(no quotes)

Expand Down
8 changes: 4 additions & 4 deletions app/api/acquia/applications/route.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { NextRequest, NextResponse } from 'next/server';
import AcquiaApiServiceFixed from '@/lib/acquia-api-fixed';
import AcquiaApiServiceFixed from '@/lib/acquia-api';

export async function GET(request: NextRequest) {
console.log('🚀 Applications API Route called');
// console.log('🚀 Applications API Route called');

// Update the API service initialization with better error handling
if (!process.env.ACQUIA_API_KEY || !process.env.ACQUIA_API_SECRET) {
Expand Down Expand Up @@ -31,11 +31,11 @@ export async function GET(request: NextRequest) {
apiSecret: process.env.ACQUIA_API_SECRET!,
});

console.log('🔧 Using FIXED API Service for applications');
// console.log('🔧 Using FIXED API Service for applications');

const applications = await apiService.getApplications();

console.log('✅ Successfully fetched applications data, count:', applications.length);
// console.log('✅ Successfully fetched applications data, count:', applications.length);

return NextResponse.json(applications);
} catch (error) {
Expand Down
11 changes: 6 additions & 5 deletions app/api/acquia/views/route.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import { NextRequest, NextResponse } from 'next/server';
import AcquiaApiServiceFixed from '@/lib/acquia-api-fixed';
import AcquiaApiServiceFixed from '@/lib/acquia-api';

export async function GET(request: NextRequest) {
const searchParams = request.nextUrl.searchParams;
const subscriptionUuid = searchParams.get('subscriptionUuid');
const from = searchParams.get('from');
const to = searchParams.get('to');

/**
console.log('🚀 Views by Application API Route called with params:', {
subscriptionUuid,
from,
to,
});
*/

if (!subscriptionUuid) {
console.error('❌ Missing required parameter: subscriptionUuid');
Expand Down Expand Up @@ -49,18 +50,18 @@ export async function GET(request: NextRequest) {
});

apiService.setProgressCallback((progress) => {
console.log('📈 Views progress:', progress);
// console.log('📈 Views progress:', progress);
});

console.log('🔧 Using FIXED API Service for views by application (with pagination)');
// console.log('🔧 Using FIXED API Service for views by application (with pagination)');

const data = await apiService.getViewsDataByApplication(
subscriptionUuid,
from || undefined,
to || undefined
);

console.log('✅ Successfully fetched ALL views by application data, total count:', data.length);
// console.log('✅ Successfully fetched ALL views by application data, total count:', data.length);

return NextResponse.json({
data,
Expand Down
10 changes: 6 additions & 4 deletions app/api/acquia/visits/route.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import { NextRequest, NextResponse } from 'next/server';
import AcquiaApiServiceFixed from '@/lib/acquia-api-fixed';
import AcquiaApiServiceFixed from '@/lib/acquia-api';

export async function GET(request: NextRequest) {
const searchParams = request.nextUrl.searchParams;
const subscriptionUuid = searchParams.get('subscriptionUuid');
const from = searchParams.get('from');
const to = searchParams.get('to');

/**
console.log('🚀 Visits by Application API Route called with params:', {
subscriptionUuid,
from,
to
});
*/

if (!subscriptionUuid) {
console.error('❌ Missing required parameter: subscriptionUuid');
Expand Down Expand Up @@ -48,14 +50,14 @@ export async function GET(request: NextRequest) {
});

apiService.setProgressCallback((progress) => {
console.log('📊 Visits progress:', progress);
// console.log('📊 Visits progress:', progress);
});

console.log('🔧 Using FIXED API Service for visits by application (with pagination)');
// console.log('🔧 Using FIXED API Service for visits by application (with pagination)');

const data = await apiService.getVisitsDataByApplication(subscriptionUuid, from || undefined, to || undefined);

console.log('✅ Successfully fetched ALL visits by application data, total count:', data.length);
// console.log('✅ Successfully fetched ALL visits by application data, total count:', data.length);

return NextResponse.json({
data,
Expand Down
36 changes: 0 additions & 36 deletions app/api/check-credentials/route.ts

This file was deleted.

24 changes: 0 additions & 24 deletions app/api/check-env-vars/route.ts

This file was deleted.

Loading