Skip to content

Commit 86af7e4

Browse files
committed
Configure production profiles and Azure deployment workflow
0 parents  commit 86af7e4

64 files changed

Lines changed: 4543 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/backend.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Deploy Backend to Azure
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
build_and_deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Set up Java 17
14+
uses: actions/setup-java@v4
15+
with:
16+
java-version: '17'
17+
distribution: 'temurin'
18+
cache: 'maven'
19+
20+
- name: Build with Maven
21+
run: mvn clean package -DskipTests
22+
23+
- name: Deploy to Azure App Service
24+
uses: azure/webapps-deploy@v3
25+
with:
26+
app-name: ${{ secrets.AZURE_WEBAPP_NAME }}
27+
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
28+
package: 'target/*.jar'

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Compiled class files
2+
target/
3+
*.class
4+
5+
# Log files
6+
*.log
7+
8+
# Blueprints/IDE files
9+
.idea/
10+
*.iml
11+
.settings/
12+
.classpath
13+
.project
14+
.factorypath
15+
bin/
16+
17+
# OS generated files
18+
.DS_Store
19+
Thumbs.db
20+
21+
# Project specific
22+
uploads/
23+
/src/main/resources/uploads/
24+
/doc/

HELP.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Read Me First
2+
The following was discovered as part of building this project:
3+
4+
* The original package name 'com.cognizant. Defects management' is invalid and this project uses 'com.cognizant.Defects.management' instead.
5+
6+
# Getting Started
7+
8+
### Reference Documentation
9+
For further reference, please consider the following sections:
10+
11+
* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
12+
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/3.2.2/maven-plugin/reference/html/)
13+
* [Create an OCI image](https://docs.spring.io/spring-boot/docs/3.2.2/maven-plugin/reference/html/#build-image)
14+
* [Spring Web](https://docs.spring.io/spring-boot/docs/3.2.2/reference/htmlsingle/index.html#web)
15+
* [Spring Boot DevTools](https://docs.spring.io/spring-boot/docs/3.2.2/reference/htmlsingle/index.html#using.devtools)
16+
* [Spring Data JPA](https://docs.spring.io/spring-boot/docs/3.2.2/reference/htmlsingle/index.html#data.sql.jpa-and-spring-data)
17+
18+
### Guides
19+
The following guides illustrate how to use some features concretely:
20+
21+
* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/)
22+
* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/)
23+
* [Building REST services with Spring](https://spring.io/guides/tutorials/rest/)
24+
* [Accessing Data with JPA](https://spring.io/guides/gs/accessing-data-jpa/)
25+

README.md

Lines changed: 312 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,312 @@
1+
# Jira - Defect Management
2+
3+
Jira - Defect Management is a Spring Boot application designed to manage and track defects (bugs) in software projects. This application provides a RESTful API for creating, updating, and retrieving defect information, as well as generating reports.
4+
5+
## Technologies Used
6+
7+
- **Spring Boot 3.2.2**
8+
- **Data JPA**
9+
- **Web**
10+
- **AOP**
11+
- **Devtools**
12+
- **H2 Database** (for testing)
13+
- **springdoc-openapi** 2.4.0
14+
- **JUnit 5**
15+
- **junit-jupiter-api**
16+
- **junit-jupiter-engine**
17+
- **Mockito** 3.12.4
18+
- **Lombok**
19+
- **SLF4J** 2.0.11
20+
- **Logback** 1.4.14
21+
- **Validation API** 2.0.1.Final
22+
- **Hibernate Validator** 7.0.2.Final
23+
- **MySQL Connector Java** 8.0.33
24+
- **Jacoco** 0.8.7
25+
26+
## Getting Started
27+
28+
### Prerequisites
29+
30+
- Java 17
31+
- Maven
32+
- MySQL
33+
34+
### Setup
35+
36+
1. **Clone the repository:**
37+
```bash
38+
git clone https://github.com/yourusername/defects-management.git
39+
cd defects-management
40+
```
41+
42+
2. **Configure the database:**
43+
44+
Update the `application.properties` file with your MySQL database configuration.
45+
46+
```properties
47+
spring.datasource.url=jdbc:mysql://localhost:3306/yourdatabase
48+
spring.datasource.username=yourusername
49+
spring.datasource.password=yourpassword
50+
spring.jpa.hibernate.ddl-auto=update
51+
```
52+
53+
3. **Build and run the application:**
54+
55+
```bash
56+
mvn clean install
57+
mvn spring-boot:run
58+
```
59+
60+
4. **Access the API documentation:**
61+
62+
Open your browser and go to `http://localhost:8080/swagger-ui.html` to view and interact with the API documentation.
63+
64+
## API Endpoints
65+
66+
### Authentication
67+
68+
- **Authenticate User**
69+
- **URL:** `/api/users/login`
70+
- **Method:** `POST`
71+
- **Description:** Authenticate valid user credentials.
72+
- **Request Body:**
73+
```json
74+
{
75+
"userName": "string",
76+
"password": "string"
77+
}
78+
```
79+
- **Response:**
80+
- **200 OK**
81+
```json
82+
{
83+
"userName": "string",
84+
"password": "string",
85+
"role": "string",
86+
"accountLocked": false
87+
}
88+
```
89+
- **401 Unauthorized**
90+
```json
91+
{
92+
"error": "Invalid username or password"
93+
}
94+
```
95+
96+
### Defect Management
97+
98+
- **Create a new defect**
99+
- **URL:** `/api/defects/new`
100+
- **Method:** `POST`
101+
- **Description:** Create a new defect.
102+
- **Request Body:**
103+
```json
104+
{
105+
"title": "string",
106+
"defectdetails": "string",
107+
"stepstoreproduce": "string",
108+
"priority": "string",
109+
"detectedon": "YYYY-MM-DD",
110+
"expectedresolution": "YYYY-MM-DD",
111+
"reportedbytesterid": "string",
112+
"assignedtodeveloperid": "string",
113+
"severity": "string",
114+
"status": "string",
115+
"projectcode": "string",
116+
"resolutions": [
117+
{
118+
"resolutiondate": "YYYY-MM-DD",
119+
"resolution": "string"
120+
}
121+
]
122+
}
123+
```
124+
- **Response:**
125+
- **201 Created**
126+
```json
127+
{
128+
"message": "Success"
129+
}
130+
```
131+
- **403 Forbidden**
132+
```json
133+
{
134+
"error": "Maximum bug assignment limit reached for today."
135+
}
136+
```
137+
- **400 Bad Request**
138+
```json
139+
{
140+
"error": "Error message"
141+
}
142+
```
143+
144+
- **Update the status and provide resolution to a defect**
145+
- **URL:** `/api/defects/resolve`
146+
- **Method:** `PUT`
147+
- **Description:** Update the status and provide resolution to a defect.
148+
- **Request Body:**
149+
```json
150+
{
151+
"id": 1,
152+
"status": "string",
153+
"resolutions": [
154+
{
155+
"resolutiondate": "YYYY-MM-DD",
156+
"resolution": "string"
157+
}
158+
]
159+
}
160+
```
161+
- **Response:**
162+
- **200 OK**
163+
```json
164+
{
165+
"message": "Success"
166+
}
167+
```
168+
- **404 Not Found**
169+
```json
170+
{
171+
"error": "Defect not found"
172+
}
173+
```
174+
175+
- **Get defects assigned to a developer**
176+
- **URL:** `/api/defects/assignedto/{developerId}`
177+
- **Method:** `GET`
178+
- **Description:** Get defects based on DeveloperId.
179+
- **Response:**
180+
- **200 OK**
181+
```json
182+
[
183+
{
184+
"id": 1,
185+
"title": "string",
186+
"defectdetails": "string",
187+
"stepstoreproduce": "string",
188+
"priority": "string",
189+
"detectedon": "YYYY-MM-DD",
190+
"expectedresolution": "YYYY-MM-DD",
191+
"reportedbytesterid": "string",
192+
"assignedtodeveloperid": "string",
193+
"severity": "string",
194+
"status": "string",
195+
"projectcode": "string",
196+
"resolutions": [
197+
{
198+
"id": 1,
199+
"defectId": 1,
200+
"resolutiondate": "YYYY-MM-DD",
201+
"resolution": "string"
202+
}
203+
]
204+
}
205+
]
206+
```
207+
208+
- **Get defect details by ID**
209+
- **URL:** `/api/defects/{defectId}`
210+
- **Method:** `GET`
211+
- **Description:** Get defects based on Id.
212+
- **Response:**
213+
- **200 OK**
214+
```json
215+
{
216+
"id": 1,
217+
"title": "string",
218+
"defectdetails": "string",
219+
"stepstoreproduce": "string",
220+
"priority": "string",
221+
"detectedon": "YYYY-MM-DD",
222+
"expectedresolution": "YYYY-MM-DD",
223+
"reportedbytesterid": "string",
224+
"assignedtodeveloperid": "string",
225+
"severity": "string",
226+
"status": "string",
227+
"projectcode": "string",
228+
"resolutions": [
229+
{
230+
"id": 1,
231+
"defectId": 1,
232+
"resolutiondate": "YYYY-MM-DD",
233+
"resolution": "string"
234+
}
235+
]
236+
}
237+
```
238+
239+
- **Generate report based on project code**
240+
- **URL:** `/api/defects/report/{projectId}`
241+
- **Method:** `GET`
242+
- **Description:** Generate report based on project code.
243+
- **Response:**
244+
- **200 OK**
245+
```json
246+
{
247+
"projectId": 1,
248+
"defects": [
249+
{
250+
"id": 1,
251+
"title": "string",
252+
"defectdetails": "string",
253+
"stepstoreproduce": "string",
254+
"priority": "string",
255+
"detectedon": "YYYY-MM-DD",
256+
"expectedresolution": "YYYY-MM-DD",
257+
"reportedbytesterid": "string",
258+
"assignedtodeveloperid": "string",
259+
"severity": "string",
260+
"status": "string",
261+
"projectcode": "string",
262+
"resolutions": [
263+
{
264+
"id": 1,
265+
"defectId": 1,
266+
"resolutiondate": "YYYY-MM-DD",
267+
"resolution": "string"
268+
}
269+
]
270+
}
271+
]
272+
}
273+
```
274+
275+
- **Get all defects**
276+
- **URL:** `/api/defects/getAll`
277+
- **Method:** `GET`
278+
- **Description:** Get all defects.
279+
- **Response:**
280+
- **200 OK**
281+
```json
282+
[
283+
{
284+
"id": 1,
285+
"title": "string",
286+
"defectdetails": "string",
287+
"stepstoreproduce": "string",
288+
"priority": "string",
289+
"detectedon": "YYYY-MM-DD",
290+
"expectedresolution": "YYYY-MM-DD",
291+
"reportedbytesterid": "string",
292+
"assignedtodeveloperid": "string",
293+
"severity": "string",
294+
"status": "string",
295+
"projectcode": "string",
296+
"resolutions": [
297+
{
298+
"id": 1,
299+
"defectId": 1,
300+
"resolutiondate": "YYYY-MM-DD",
301+
"resolution": "string"
302+
}
303+
]
304+
}
305+
]
306+
```
307+
308+
309+
## Acknowledgments
310+
311+
- Thanks to the Spring Boot community for their comprehensive documentation and support.
312+
- Inspired by Jira for defect management concepts.

0 commit comments

Comments
 (0)